Public Member Functions | List of all members
sdf::v9::World Class Reference

#include <World.hh>

Public Member Functions

 World ()
 Default constructor. More...
 
 World (const World &_world)
 Copy constructor. More...
 
 World (World &&_world) noexcept
 Move constructor. More...
 
 ~World ()
 Destructor. More...
 
const ActorActorByIndex (const uint64_t _index) const
 Get an actor based on an index. More...
 
uint64_t ActorCount () const
 Get the number of actors. More...
 
bool ActorNameExists (const std::string &_name) const
 Get whether an actor name exists. More...
 
const sdf::Atmosphere * Atmosphere () const
 Get a pointer to the atmosphere model associated with this world. More...
 
std::string AudioDevice () const
 Get the audio device name. More...
 
sdf::ElementPtr Element () const
 Get a pointer to the SDF element that was used during load. More...
 
const FrameFrameByIndex (const uint64_t _index) const
 Get an explicit frame based on an index. More...
 
const FrameFrameByName (const std::string &_name) const
 Get an explicit frame based on a name. More...
 
uint64_t FrameCount () const
 Get the number of explicit frames. More...
 
bool FrameNameExists (const std::string &_name) const
 Get whether an explicit frame name exists. More...
 
ignition::math::Vector3d Gravity () const
 Get the acceleration due to gravity. More...
 
sdf::Gui * Gui () const
 Get a pointer to the Gui associated with this world. More...
 
const LightLightByIndex (const uint64_t _index) const
 Get a light based on an index. More...
 
uint64_t LightCount () const
 Get the number of lights. More...
 
bool LightNameExists (const std::string &_name) const
 Get whether a light name exists. More...
 
Errors Load (ElementPtr _sdf)
 Load the world based on a element pointer. More...
 
ignition::math::Vector3d MagneticField () const
 Get the magnetic vector in Tesla, expressed in a coordinate frame defined by the SphericalCoordinates property. More...
 
const ModelModelByIndex (const uint64_t _index) const
 Get a model based on an index. More...
 
const ModelModelByName (const std::string &_name) const
 Get a model based on a name. More...
 
uint64_t ModelCount () const
 Get the number of models. More...
 
bool ModelNameExists (const std::string &_name) const
 Get whether a model name exists. More...
 
std::string Name () const
 Get the name of the world. More...
 
Worldoperator= (World &&_world)
 Move assignment operator. More...
 
Worldoperator= (const World &_world)
 Copy assignment operator. More...
 
const PhysicsPhysicsByIndex (const uint64_t _index) const
 Get a physics profile based on an index. More...
 
uint64_t PhysicsCount () const
 Get the number of physics profiles. More...
 
const PhysicsPhysicsDefault () const
 Get the default physics profile. More...
 
bool PhysicsNameExists (const std::string &_name) const
 Get whether a physics profile name exists. More...
 
const sdf::Scene * Scene () const
 Get a pointer to the Scene associated with this world. More...
 
void SetAtmosphere (const sdf::Atmosphere &_atmosphere) const
 Set the atmosphere model associated with this world. More...
 
void SetAudioDevice (const std::string &_device)
 Set the audio device name. More...
 
void SetGravity (const ignition::math::Vector3d &_gravity)
 Set the acceleration due to gravity. More...
 
void SetGui (const sdf::Gui &_gui)
 Set the Gui parameters associated with this world. More...
 
void SetMagneticField (const ignition::math::Vector3d &_mag)
 Set the magnetic vector in Tesla, expressed in a coordinate frame defined by the SphericalCoordinate. More...
 
void SetName (const std::string &_name) const
 Set the name of the world. More...
 
void SetScene (const sdf::Scene &_scene)
 Set the Scene parameters associated with this world. More...
 
void SetWindLinearVelocity (const ignition::math::Vector3d &_wind)
 Set the wind linear velocity in the global/world coordinate frame. More...
 
ignition::math::Vector3d WindLinearVelocity () const
 Get the wind linear velocity in the global/world coordinate frame. More...
 

Constructor & Destructor Documentation

◆ World() [1/3]

sdf::v9::World::World ( )

Default constructor.

◆ World() [2/3]

sdf::v9::World::World ( const World _world)

Copy constructor.

Parameters
[in]_worldWorld to copy.

◆ World() [3/3]

sdf::v9::World::World ( World &&  _world)
noexcept

Move constructor.

Parameters
[in]_worldWorld to move.

◆ ~World()

sdf::v9::World::~World ( )

Destructor.

Member Function Documentation

◆ ActorByIndex()

const Actor* sdf::v9::World::ActorByIndex ( const uint64_t  _index) const

Get an actor based on an index.

Parameters
[in]_indexIndex of the actor. The index should be in the range [0..ActorCount()).
Returns
Pointer to the actor. Nullptr if the index does not exist.
See also
uint64_t ActorCount() const

◆ ActorCount()

uint64_t sdf::v9::World::ActorCount ( ) const

Get the number of actors.

Returns
Number of actors contained in this World object.

◆ ActorNameExists()

bool sdf::v9::World::ActorNameExists ( const std::string &  _name) const

Get whether an actor name exists.

Parameters
[in]_nameName of the actor to check.
Returns
True if there exists an actor with the given name.

◆ Atmosphere()

const sdf::Atmosphere* sdf::v9::World::Atmosphere ( ) const

Get a pointer to the atmosphere model associated with this world.

A nullptr indicates that an atmosphere model has not been set.

Returns
Pointer to this world's atmosphere model. Nullptr inidicates that there is no atmosphere model.

◆ AudioDevice()

std::string sdf::v9::World::AudioDevice ( ) const

Get the audio device name.

The audio device can be used to playback audio files. A value of "default" or an empty string indicates that the system's default audio device should be used.

Returns
Audio device name.

◆ Element()

sdf::ElementPtr sdf::v9::World::Element ( ) const

Get a pointer to the SDF element that was used during load.

Returns
SDF element pointer. The value will be nullptr if Load has not been called.

◆ FrameByIndex()

const Frame* sdf::v9::World::FrameByIndex ( const uint64_t  _index) const

Get an explicit frame based on an index.

Parameters
[in]_indexIndex of the explicit frame. The index should be in the range [0..FrameCount()).
Returns
Pointer to the explicit frame. Nullptr if the index does not exist.
See also
uint64_t FrameCount() const

◆ FrameByName()

const Frame* sdf::v9::World::FrameByName ( const std::string &  _name) const

Get an explicit frame based on a name.

Parameters
[in]_nameName of the explicit frame.
Returns
Pointer to the explicit frame. Nullptr if the name does not exist.

◆ FrameCount()

uint64_t sdf::v9::World::FrameCount ( ) const

Get the number of explicit frames.

Returns
Number of explicit frames contained in this World object.

◆ FrameNameExists()

bool sdf::v9::World::FrameNameExists ( const std::string &  _name) const

Get whether an explicit frame name exists.

Parameters
[in]_nameName of the explicit frame to check.
Returns
True if there exists an explicit frame with the given name.

◆ Gravity()

ignition::math::Vector3d sdf::v9::World::Gravity ( ) const

Get the acceleration due to gravity.

The default value is Earth's standard gravity at sea level, which equals [0, 0, -9.80665] \((\frac{m}{s^2})\)

Returns
Gravity vector in meters per second squared \((\frac{m}{s^2})\)

◆ Gui()

sdf::Gui* sdf::v9::World::Gui ( ) const

Get a pointer to the Gui associated with this world.

A nullptr indicates that a Gui element has not been specified.

Returns
Pointer to this world's Gui parameters. Nullptr inidicates that there are no Gui parameters.

◆ LightByIndex()

const Light* sdf::v9::World::LightByIndex ( const uint64_t  _index) const

Get a light based on an index.

Parameters
[in]_indexIndex of the light. The index should be in the range [0..LightCount()).
Returns
Pointer to the light. Nullptr if the index does not exist.
See also
uint64_t LightCount() const

◆ LightCount()

uint64_t sdf::v9::World::LightCount ( ) const

Get the number of lights.

Returns
Number of lights contained in this World object.

◆ LightNameExists()

bool sdf::v9::World::LightNameExists ( const std::string &  _name) const

Get whether a light name exists.

Parameters
[in]_nameName of the light to check.
Returns
True if there exists a light with the given name.

◆ Load()

Errors sdf::v9::World::Load ( ElementPtr  _sdf)

Load the world based on a element pointer.

This is not the usual entry point. Typical usage of the SDF DOM is through the Root object.

Parameters
[in]_sdfThe SDF Element pointer
Returns
Errors, which is a vector of Error objects. Each Error includes an error code and message. An empty vector indicates no error.

◆ MagneticField()

ignition::math::Vector3d sdf::v9::World::MagneticField ( ) const

Get the magnetic vector in Tesla, expressed in a coordinate frame defined by the SphericalCoordinates property.

A spherical coordinate can be specified in SDF using the <spherical_coordinates> element.

Returns
Magnetic field vector.
See also
SphericalCoordinates

◆ ModelByIndex()

const Model* sdf::v9::World::ModelByIndex ( const uint64_t  _index) const

Get a model based on an index.

Parameters
[in]_indexIndex of the model. The index should be in the range [0..ModelCount()).
Returns
Pointer to the model. Nullptr if the index does not exist.
See also
uint64_t ModelCount() const

◆ ModelByName()

const Model* sdf::v9::World::ModelByName ( const std::string &  _name) const

Get a model based on a name.

Parameters
[in]_nameName of the model.
Returns
Pointer to the model. Nullptr if the name does not exist.

◆ ModelCount()

uint64_t sdf::v9::World::ModelCount ( ) const

Get the number of models.

Returns
Number of models contained in this World object.

◆ ModelNameExists()

bool sdf::v9::World::ModelNameExists ( const std::string &  _name) const

Get whether a model name exists.

Parameters
[in]_nameName of the model to check.
Returns
True if there exists a model with the given name.

◆ Name()

std::string sdf::v9::World::Name ( ) const

Get the name of the world.

Returns
Name of the world.

◆ operator=() [1/2]

World& sdf::v9::World::operator= ( World &&  _world)

Move assignment operator.

Parameters
[in]_worldWorld to move.
Returns
Reference to this.

◆ operator=() [2/2]

World& sdf::v9::World::operator= ( const World _world)

Copy assignment operator.

Parameters
[in]_worldWorld to copy.
Returns
Reference to this.

◆ PhysicsByIndex()

const Physics* sdf::v9::World::PhysicsByIndex ( const uint64_t  _index) const

Get a physics profile based on an index.

Parameters
[in]_indexIndex of the physics profile. The index should be in the range [0..PhysicsCount()).
Returns
Pointer to the physics profile. Nullptr if the index does not exist.

◆ PhysicsCount()

uint64_t sdf::v9::World::PhysicsCount ( ) const

Get the number of physics profiles.

Returns
Number of physics profiles contained in this World object.

◆ PhysicsDefault()

const Physics* sdf::v9::World::PhysicsDefault ( ) const

Get the default physics profile.

Returns
Pointer to the default physics profile.

◆ PhysicsNameExists()

bool sdf::v9::World::PhysicsNameExists ( const std::string &  _name) const

Get whether a physics profile name exists.

Parameters
[in]_nameName of the physics profile to check.
Returns
True if there exists a physics profile with the given name.

◆ Scene()

const sdf::Scene* sdf::v9::World::Scene ( ) const

Get a pointer to the Scene associated with this world.

A nullptr indicates that a Scene element has not been specified.

Returns
Pointer to this world's Scene parameters. Nullptr inidicates that there are no Scene parameters.

◆ SetAtmosphere()

void sdf::v9::World::SetAtmosphere ( const sdf::Atmosphere &  _atmosphere) const

Set the atmosphere model associated with this world.

Parameters
[in]_atmosphereThe new atmosphere model for this world.

◆ SetAudioDevice()

void sdf::v9::World::SetAudioDevice ( const std::string &  _device)

Set the audio device name.

See std::string AudioDevice() const for more information.

Parameters
[in]_deviceThe new audio device name.
See also
std::string AudioDevice() const

◆ SetGravity()

void sdf::v9::World::SetGravity ( const ignition::math::Vector3d &  _gravity)

Set the acceleration due to gravity.

Units are meters per second squared \((\frac{m}{s^2})\)

Parameters
[in]_gravityThe new gravity vector.

◆ SetGui()

void sdf::v9::World::SetGui ( const sdf::Gui &  _gui)

Set the Gui parameters associated with this world.

Parameters
[in]_guiThe new Gui parameter for this world

◆ SetMagneticField()

void sdf::v9::World::SetMagneticField ( const ignition::math::Vector3d &  _mag)

Set the magnetic vector in Tesla, expressed in a coordinate frame defined by the SphericalCoordinate.

A spherical coordinate can be specified in SDF using the <spherical_coordinates> element.

Parameters
[in]_magThe new magnetic field vector.
See also
SphericalCoordinates

◆ SetName()

void sdf::v9::World::SetName ( const std::string &  _name) const

Set the name of the world.

Parameters
[in]_nameName of the world.

◆ SetScene()

void sdf::v9::World::SetScene ( const sdf::Scene &  _scene)

Set the Scene parameters associated with this world.

Parameters
[in]_guiThe new Scene parameter for this world

◆ SetWindLinearVelocity()

void sdf::v9::World::SetWindLinearVelocity ( const ignition::math::Vector3d &  _wind)

Set the wind linear velocity in the global/world coordinate frame.

Units are meters per second \((\frac{m}{s})\)

Parameters
[in]_windThe new linear velocity of wind.
See also
ignition::math::Vector3d WindLinearVelocity() const

◆ WindLinearVelocity()

ignition::math::Vector3d sdf::v9::World::WindLinearVelocity ( ) const

Get the wind linear velocity in the global/world coordinate frame.

Units are meters per second \((\frac{m}{s})\)

Returns
Linear velocity of wind in the global/world coordinate frame.
See also
void SetWindLinearVelocity(const ignition::math::Vector3d &_wind)

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