This class provides wrappers around entities and components which are more convenient and straight-forward to use than dealing with the EntityComponentManager directly. All the functions provided here are meant to be used with a model entity.  
 More...
#include <gz/sim/Model.hh>
Public Member Functions | |
| Model (const Model &_model) | |
| Copy constructor.   | |
| Model (Model &&_model) noexcept | |
| Move constructor.   | |
| Model (sim::Entity _entity=kNullEntity) | |
| Constructor.   | |
| virtual | ~Model () | 
| Destructor.   | |
| sim::Entity | CanonicalLink (const EntityComponentManager &_ecm) const | 
| Get the model's canonical link entity.   | |
| sim::Entity | Entity () const | 
| Get the entity which this Model is related to.   | |
| sim::Entity | JointByName (const EntityComponentManager &_ecm, const std::string &_name) const | 
| Get the ID of a joint entity which is an immediate child of this model.   | |
| uint64_t | JointCount (const EntityComponentManager &_ecm) const | 
| Get the number of joints which are immediate children of this model.   | |
| std::vector< sim::Entity > | Joints (const EntityComponentManager &_ecm) const | 
| Get all joints which are immediate children of this model.   | |
| sim::Entity | LinkByName (const EntityComponentManager &_ecm, const std::string &_name) const | 
| Get the ID of a link entity which is an immediate child of this model.   | |
| uint64_t | LinkCount (const EntityComponentManager &_ecm) const | 
| Get the number of links which are immediate children of this model.   | |
| std::vector< sim::Entity > | Links (const EntityComponentManager &_ecm) const | 
| Get all links which are immediate children of this model.   | |
| sim::Entity | ModelByName (const EntityComponentManager &_ecm, const std::string &_name) const | 
| Get the ID of a nested model entity which is an immediate child of this model.   | |
| uint64_t | ModelCount (const EntityComponentManager &_ecm) const | 
| Get the number of nested models which are immediate children of this model.   | |
| std::vector< sim::Entity > | Models (const EntityComponentManager &_ecm) const | 
| Get all models which are immediate children of this model.   | |
| std::string | Name (const EntityComponentManager &_ecm) const | 
| Get the model's unscoped name.   | |
| Model & | operator= (const Model &_model) | 
| Copy assignment operator.   | |
| Model & | operator= (Model &&_model) noexcept | 
| Move assignment operator.   | |
| bool | SelfCollide (const EntityComponentManager &_ecm) const | 
| Get whether this model has self-collide enabled.   | |
| void | SetWorldPoseCmd (EntityComponentManager &_ecm, const math::Pose3d &_pose) | 
| Set a command to change the model's pose.   | |
| std::string | SourceFilePath (const EntityComponentManager &_ecm) const | 
| Get the source file where this model came from. If empty, the model wasn't loaded directly from a file, probably from an SDF string.   | |
| bool | Static (const EntityComponentManager &_ecm) const | 
| Get whether this model is static.   | |
| bool | Valid (const EntityComponentManager &_ecm) const | 
| Check whether this model correctly refers to an entity that has a components::Model.   | |
| bool | WindMode (const EntityComponentManager &_ecm) const | 
| Get whether this model has wind enabled.   | |
Detailed Description
This class provides wrappers around entities and components which are more convenient and straight-forward to use than dealing with the EntityComponentManager directly. All the functions provided here are meant to be used with a model entity. 
For example, given a model's entity, to find the value of its name component, one could use the entity-component manager (ecm) directly as follows: 
std::string name = ecm.Component<components::Name>(entity)->Data();
Using this class however, the same information can be obtained with a simpler function call:
Model model(entity); std::string name = model.Name(ecm);
- Todo:
 - (louise) Store the ecm instead of passing it at every API call.
 
Constructor & Destructor Documentation
◆ Model() [1/3]
      
  | 
  explicit | 
Constructor.
- Parameters
 - 
  
[in] _entity Model entity  
◆ Model() [2/3]
◆ Model() [3/3]
◆ ~Model()
      
  | 
  virtual | 
Destructor.
Member Function Documentation
◆ CanonicalLink()
| sim::Entity CanonicalLink | ( | const EntityComponentManager & | _ecm | ) | const | 
Get the model's canonical link entity.
- Parameters
 - 
  
[in] _ecm Entity-component manager.  
- Returns
 - Link entity.
 
◆ Entity()
| sim::Entity Entity | ( | ) | const | 
◆ JointByName()
| sim::Entity JointByName | ( | const EntityComponentManager & | _ecm, | 
| const std::string & | _name | ||
| ) | const | 
◆ JointCount()
| uint64_t JointCount | ( | const EntityComponentManager & | _ecm | ) | const | 
Get the number of joints which are immediate children of this model.
- Parameters
 - 
  
[in] _ecm Entity-component manager.  
- Returns
 - Number of joints in this model.
 
◆ Joints()
| std::vector< sim::Entity > Joints | ( | const EntityComponentManager & | _ecm | ) | const | 
Get all joints which are immediate children of this model.
- Parameters
 - 
  
[in] _ecm Entity-component manager.  
- Returns
 - All joints in this model.
 
◆ LinkByName()
| sim::Entity LinkByName | ( | const EntityComponentManager & | _ecm, | 
| const std::string & | _name | ||
| ) | const | 
◆ LinkCount()
| uint64_t LinkCount | ( | const EntityComponentManager & | _ecm | ) | const | 
Get the number of links which are immediate children of this model.
- Parameters
 - 
  
[in] _ecm Entity-component manager.  
- Returns
 - Number of links in this model.
 
◆ Links()
| std::vector< sim::Entity > Links | ( | const EntityComponentManager & | _ecm | ) | const | 
Get all links which are immediate children of this model.
- Parameters
 - 
  
[in] _ecm Entity-component manager.  
- Returns
 - All links in this model.
 
◆ ModelByName()
| sim::Entity ModelByName | ( | const EntityComponentManager & | _ecm, | 
| const std::string & | _name | ||
| ) | const | 
Get the ID of a nested model entity which is an immediate child of this model.
- Parameters
 - 
  
[in] _ecm Entity-component manager. [in] _name Nested model name.  
- Returns
 - Nested model entity.
 
◆ ModelCount()
| uint64_t ModelCount | ( | const EntityComponentManager & | _ecm | ) | const | 
Get the number of nested models which are immediate children of this model.
- Parameters
 - 
  
[in] _ecm Entity-component manager.  
- Returns
 - Number of nested models in this model.
 
◆ Models()
| std::vector< sim::Entity > Models | ( | const EntityComponentManager & | _ecm | ) | const | 
Get all models which are immediate children of this model.
- Parameters
 - 
  
[in] _ecm Entity-component manager.  
- Returns
 - All models in this model.
 
◆ Name()
| std::string Name | ( | const EntityComponentManager & | _ecm | ) | const | 
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ SelfCollide()
| bool SelfCollide | ( | const EntityComponentManager & | _ecm | ) | const | 
Get whether this model has self-collide enabled.
- Parameters
 - 
  
[in] _ecm Entity-component manager.  
- Returns
 - True if self-colliding.
 
◆ SetWorldPoseCmd()
| void SetWorldPoseCmd | ( | EntityComponentManager & | _ecm, | 
| const math::Pose3d & | _pose | ||
| ) | 
Set a command to change the model's pose.
- Parameters
 - 
  
[in] _ecm Entity-component manager. [in] _pose New model pose.  
◆ SourceFilePath()
| std::string SourceFilePath | ( | const EntityComponentManager & | _ecm | ) | const | 
Get the source file where this model came from. If empty, the model wasn't loaded directly from a file, probably from an SDF string.
- Parameters
 - 
  
[in] _ecm Entity-component manager.  
- Returns
 - Path to the source SDF file.
 
◆ Static()
| bool Static | ( | const EntityComponentManager & | _ecm | ) | const | 
Get whether this model is static.
- Parameters
 - 
  
[in] _ecm Entity-component manager.  
- Returns
 - True if static.
 
◆ Valid()
| bool Valid | ( | const EntityComponentManager & | _ecm | ) | const | 
Check whether this model correctly refers to an entity that has a components::Model.
- Parameters
 - 
  
[in] _ecm Entity-component manager.  
- Returns
 - True if it's a valid model in the manager.
 
◆ WindMode()
| bool WindMode | ( | const EntityComponentManager & | _ecm | ) | const | 
Get whether this model has wind enabled.
- Parameters
 - 
  
[in] _ecm Entity-component manager.  
- Returns
 - True if wind mode is on.
 
The documentation for this class was generated from the following file: