Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
moveit_rviz_plugin::PropertyFactory Class Reference

#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 *)>
 

Public Member Functions

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 More...
 
rviz::Propertycreate (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 More...
 
rviz::PropertyTreeModelcreatePropertyTreeModel (moveit::task_constructor::Stage &stage, const planning_scene::PlanningScene *scene, rviz::DisplayContext *display_context)
 create PropertyTreeModel for given Stage More...
 
rviz::PropertyTreeModeldefaultPropertyTreeModel (moveit::task_constructor::PropertyMap &properties, const planning_scene::PlanningScene *scene, rviz::DisplayContext *display_context)
 turn a PropertyMap into an rviz::PropertyTreeModel More...
 
template<typename T >
void registerStage (const TreeFactoryFunction &f)
 register a factory function for stage T More...
 
template<typename T >
void registerType (const PropertyFactoryFunction &f)
 register a factory function for type T More...
 

Static Public Member Functions

static rviz::PropertycreateDefault (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 PropertyFactoryinstance ()
 

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, PropertyFactoryFunctionproperty_registry_
 
std::map< std::type_index, TreeFactoryFunctionstage_registry_
 

Detailed Description

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.

Member Typedef Documentation

◆ PropertyFactoryFunction

Definition at line 80 of file property_factory.h.

◆ TreeFactoryFunction

Definition at line 82 of file property_factory.h.

Constructor & Destructor Documentation

◆ PropertyFactory() [1/2]

moveit_rviz_plugin::PropertyFactory::PropertyFactory ( )
private

class is singleton

Definition at line 107 of file property_factory.cpp.

◆ PropertyFactory() [2/2]

moveit_rviz_plugin::PropertyFactory::PropertyFactory ( const PropertyFactory )
privatedelete

Member Function Documentation

◆ addRemainingProperties()

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.

◆ create()

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.

◆ createDefault()

rviz::Property * moveit_rviz_plugin::PropertyFactory::createDefault ( const std::string &  name,
const std::string &  type,
const std::string &  description,
const std::string &  value,
rviz::Property old = nullptr 
)
static

create rviz::Property for property of given name, type, description, and value

Definition at line 183 of file property_factory.cpp.

◆ createPropertyTreeModel()

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.

◆ defaultPropertyTreeModel()

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.

◆ instance()

PropertyFactory & moveit_rviz_plugin::PropertyFactory::instance ( )
static

Definition at line 114 of file property_factory.cpp.

◆ operator=()

void moveit_rviz_plugin::PropertyFactory::operator= ( const PropertyFactory )
privatedelete

◆ registerStage() [1/2]

void moveit_rviz_plugin::PropertyFactory::registerStage ( const std::type_index &  type_index,
const TreeFactoryFunction f 
)
private

Definition at line 125 of file property_factory.cpp.

◆ registerStage() [2/2]

template<typename T >
void moveit_rviz_plugin::PropertyFactory::registerStage ( const TreeFactoryFunction f)
inline

register a factory function for stage T

Definition at line 93 of file property_factory.h.

◆ registerType() [1/2]

template<typename T >
void moveit_rviz_plugin::PropertyFactory::registerType ( const PropertyFactoryFunction f)
inline

register a factory function for type T

Definition at line 86 of file property_factory.h.

◆ registerType() [2/2]

void moveit_rviz_plugin::PropertyFactory::registerType ( const std::string &  type_name,
const PropertyFactoryFunction f 
)
private

Definition at line 119 of file property_factory.cpp.

Member Data Documentation

◆ property_registry_

std::map<std::string, PropertyFactoryFunction> moveit_rviz_plugin::PropertyFactory::property_registry_
private

Definition at line 120 of file property_factory.h.

◆ stage_registry_

std::map<std::type_index, TreeFactoryFunction> moveit_rviz_plugin::PropertyFactory::stage_registry_
private

Definition at line 121 of file property_factory.h.


The documentation for this class was generated from the following files:


visualization
Author(s): Robert Haschke
autogenerated on Sat May 3 2025 02:40:38