Go to the documentation of this file.
18 #ifndef _GAZEBO_PHYSICS_PRESETMANAGER_HH_
19 #define _GAZEBO_PHYSICS_PRESETMANAGER_HH_
21 #include <boost/any.hpp>
44 public:
Preset(
const std::string & _name);
51 public: std::string
Name()
const;
59 public:
bool GetParam(
const std::string &_key, boost::any &_value)
const;
64 public:
bool SetParam(
const std::string &_key,
const boost::any &_value);
69 public:
bool HasParam(
const std::string &_key)
const;
88 private:
bool SetAllParamsHelper(
const sdf::ElementPtr _elem);
92 public: sdf::ElementPtr
SDF()
const;
97 public:
bool SDF(
const sdf::ElementPtr _sdfElement);
100 private: PresetPrivate *dataPtr;
103 class PresetManagerPrivate;
113 const sdf::ElementPtr _sdf);
137 const std::string &_key,
const boost::any &_value);
148 const std::string &_key, boost::any &_value)
const;
155 const boost::any &_value);
193 public: sdf::ElementPtr
ProfileSDF(
const std::string &_name)
const;
200 const sdf::ElementPtr _sdf);
206 sdf::ElementPtr &_elem)
const;
211 private:
void GenerateSDFHelper(
const Preset &_preset,
212 sdf::ElementPtr &_elem)
const;
217 private:
void GeneratePresetFromSDF(
const sdf::ElementPtr _elem,
222 private:
Preset *CurrentPreset()
const;
225 private: PresetManagerPrivate *dataPtr;
bool HasParam(const std::string &_key) const
Check if profile parameter is set.
bool SDF(const sdf::ElementPtr _sdfElement)
Set this preset profile's SDF.
Forward declarations for the common classes.
Definition: Animation.hh:27
bool CurrentProfile(const std::string &_name)
Set the current profile.
default namespace for gazebo
PresetManager(PhysicsEnginePtr _physicsEngine, const sdf::ElementPtr _sdf)
Constructor.
bool SetAllParamsFromSDF(const sdf::ElementPtr _elem)
Set all parameters of this preset based on the key/value pairs in the given SDF element.
bool CreateProfile(const std::string &_name)
Create a new profile.
~PresetManager()
Destructor.
bool SetProfileParam(const std::string &_profileName, const std::string &_key, const boost::any &_value)
Set a parameter for a certain profile.
sdf::ElementPtr SDF() const
Get this preset profile's SDF.
std::vector< std::string > AllProfiles() const
Get the name of all profiles.
bool GetParam(const std::string &_key, boost::any &_value) const
Get a profile parameter.
bool SetAllPhysicsParameters(PhysicsEnginePtr _physicsEngine) const
Set all parameters of this preset in the physics engine.
bool HasProfile(const std::string &_name) const
Determine if we have a profile.
Preset(const std::string &_name)
Constructor.
bool SetCurrentProfileParam(const std::string &_key, const boost::any &_value)
Set a parameter for the current profile.
Class to manage preset physics profiles.
Definition: PresetManager.hh:108
Representation of a preset physics profile.
Definition: PresetManager.hh:37
std::string CreateProfile(const sdf::ElementPtr _sdf)
Create a new profile from SDF.
bool GetCurrentProfileParam(const std::string &_key, boost::any &_value)
Get a parameter for the current profile.
sdf::ElementPtr ProfileSDF(const std::string &_name) const
Get the SDF for a profile.
boost::shared_ptr< PhysicsEngine > PhysicsEnginePtr
Definition: PhysicsTypes.hh:126
void GenerateSDFFromPreset(const std::string &_name, sdf::ElementPtr &_elem) const
Generate an SDF element from an Preset object.
void RemoveProfile(const std::string &_name)
Remove a profile.
bool ProfileSDF(const std::string &_name, const sdf::ElementPtr _sdf)
Set the SDF for a profile.
bool SetParam(const std::string &_key, const boost::any &_value)
Set a profile parameter.
bool GetProfileParam(const std::string &_name, const std::string &_key, boost::any &_value) const
Get a parameter for a certain profile.
std::string Name() const
Get the profile name.
std::string CurrentProfile() const
Get the name of the current profile.