World.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2017 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 #ifndef SDF_WORLD_HH_
18 #define SDF_WORLD_HH_
19 
20 #include <string>
21 
22 #include "sdf/Element.hh"
23 #include "sdf/Types.hh"
24 #include "sdf/system_util.hh"
25 
26 namespace sdf
27 {
28  // Forward declare private data class.
29  class WorldPrivate;
30 
32  {
34  public: World();
35 
38  public: World(World &&_world);
39 
41  public: ~World();
42 
49  public: Errors Load(ElementPtr _sdf);
50 
53  public: std::string Name() const;
54 
57  public: void SetName(const std::string &_name) const;
58 
63  public: std::string AudioDevice() const;
64 
69  public: void SetAudioDevice(const std::string &_device);
70 
75  public: ignition::math::Vector3d WindLinearVelocity() const;
76 
81  public: void SetWindLinearVelocity(const ignition::math::Vector3d &_wind);
82 
88  public: ignition::math::Vector3d Gravity() const;
89 
93  public: void SetGravity(const ignition::math::Vector3d &_gravity);
94 
101  public: ignition::math::Vector3d MagneticField() const;
102 
109  public: void SetMagneticField(const ignition::math::Vector3d &_mag);
110 
112  private: WorldPrivate *dataPtr = nullptr;
113  };
114 }
115 #endif
Definition: World.hh:32
std::string Name() const
Get the name of the world.
ignition::math::Vector3d WindLinearVelocity() const
Get the wind linear velocity in the global/world coordinate frame.
World()
Default constructor.
ignition::math::Vector3d MagneticField() const
Get the magnetic vector in Tesla, expressed in a coordinate frame defined by the SphericalCoordinates...
void SetName(const std::string &_name) const
Set the name of the world.
ignition::math::Vector3d Gravity() const
Get the acceleration due to gravity.
Errors Load(ElementPtr _sdf)
Load the world based on a element pointer.
void SetGravity(const ignition::math::Vector3d &_gravity)
Set the acceleration due to gravity.
void SetWindLinearVelocity(const ignition::math::Vector3d &_wind)
Set the wind linear velocity in the global/world coordinate frame.
~World()
Destructor.
void SetMagneticField(const ignition::math::Vector3d &_mag)
Set the magnetic vector in Tesla, expressed in a coordinate frame defined by the SphericalCoordinate.
std::string AudioDevice() const
Get the audio device name.
void SetAudioDevice(const std::string &_device)
Set the audio device name.
World(World &&_world)
Move constructor.
namespace for Simulation Description Format parser
Definition: Console.hh:36
std::shared_ptr< Element > ElementPtr
Definition: Element.hh:45
std::vector< Error > Errors
A vector of Error.
Definition: Types.hh:69
#define SDFORMAT_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system_util.hh:48