#include <property_factory.h>
Public Types | |
using | PropertyFactoryFunction = std::function< rviz::Property *(const QString &, moveit::task_constructor::Property &, const planning_scene::PlanningScene *, rviz::DisplayContext *)> |
using | TreeFactoryFunction = std::function< rviz::PropertyTreeModel *(moveit::task_constructor::PropertyMap &, const planning_scene::PlanningScene *, rviz::DisplayContext *)> |
Static Public Member Functions | |
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 More... | |
static PropertyFactory & | instance () |
Private Member Functions | |
void | operator= (const PropertyFactory &)=delete |
PropertyFactory () | |
class is singleton More... | |
PropertyFactory (const PropertyFactory &)=delete | |
void | registerStage (const std::type_index &type_index, const TreeFactoryFunction &f) |
void | registerType (const std::string &type_name, const PropertyFactoryFunction &f) |
Private Attributes | |
std::map< std::string, PropertyFactoryFunction > | property_registry_ |
std::map< std::type_index, TreeFactoryFunction > | stage_registry_ |
Registry for rviz::Property and rviz::PropertyTreeModel creator functions.
To inspect (and edit) properties of stages, our MTC properties are converted to rviz properties, which are finally shown in an rviz::PropertyTree. To allow customization of property display, one can register creator functions for individual properties as well as creator functions for a complete stage. The latter allows to fully customize the display of stage properties, e.g. hiding specific properties, or returning a subclassed PropertyTreeModel with modified behaviour. By default, defaultPropertyTreeModel() creates an rviz property for each MTC property.
Definition at line 73 of file property_factory.h.
using moveit_rviz_plugin::PropertyFactory::PropertyFactoryFunction = std::function<rviz::Property*(const QString&, moveit::task_constructor::Property&, const planning_scene::PlanningScene*, rviz::DisplayContext*)> |
Definition at line 80 of file property_factory.h.
Definition at line 82 of file property_factory.h.
|
private |
class is singleton
Definition at line 107 of file property_factory.cpp.
|
privatedelete |
void moveit_rviz_plugin::PropertyFactory::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
Definition at line 163 of file property_factory.cpp.
rviz::Property * moveit_rviz_plugin::PropertyFactory::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
Definition at line 129 of file property_factory.cpp.
|
static |
create rviz::Property for property of given name, type, description, and value
Definition at line 183 of file property_factory.cpp.
rviz::PropertyTreeModel * moveit_rviz_plugin::PropertyFactory::createPropertyTreeModel | ( | moveit::task_constructor::Stage & | stage, |
const planning_scene::PlanningScene * | scene, | ||
rviz::DisplayContext * | display_context | ||
) |
create PropertyTreeModel for given Stage
Definition at line 138 of file property_factory.cpp.
rviz::PropertyTreeModel * moveit_rviz_plugin::PropertyFactory::defaultPropertyTreeModel | ( | moveit::task_constructor::PropertyMap & | properties, |
const planning_scene::PlanningScene * | scene, | ||
rviz::DisplayContext * | display_context | ||
) |
turn a PropertyMap into an rviz::PropertyTreeModel
Definition at line 147 of file property_factory.cpp.
|
static |
Definition at line 114 of file property_factory.cpp.
|
privatedelete |
|
private |
Definition at line 125 of file property_factory.cpp.
|
inline |
register a factory function for stage T
Definition at line 93 of file property_factory.h.
|
inline |
register a factory function for type T
Definition at line 86 of file property_factory.h.
|
private |
Definition at line 119 of file property_factory.cpp.
|
private |
Definition at line 120 of file property_factory.h.
|
private |
Definition at line 121 of file property_factory.h.