File: Atmosphere.hh

package info (click to toggle)
sdformat 9.3.0%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 5,708 kB
  • sloc: cpp: 42,166; python: 1,618; javascript: 704; ruby: 368; sh: 81; ansic: 37; makefile: 16
file content (125 lines) | stat: -rw-r--r-- 4,483 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*
 * Copyright 2018 Open Source Robotics Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */
#ifndef SDF_ATMOSPHERE_HH_
#define SDF_ATMOSPHERE_HH_

#include <ignition/math/Temperature.hh>
#include "sdf/Element.hh"
#include "sdf/Types.hh"
#include "sdf/sdf_config.h"
#include "sdf/system_util.hh"

namespace sdf
{
  // Inline bracket to help doxygen filtering.
  inline namespace SDF_VERSION_NAMESPACE {
  //
  /// \enum AtmosphereType
  /// \brief The set of atmosphere model types.
  enum class AtmosphereType
  {
    /// \brief Adiabatic atmosphere model.
    ADIABATIC = 0,
  };

  // Forward declarations.
  class AtmospherePrivate;

  /// \brief The Atmosphere class contains information about
  /// an atmospheric model and related parameters such as temperature
  /// and pressure at sea level. An Atmosphere instance is optionally part of
  /// a World.
  class SDFORMAT_VISIBLE Atmosphere
  {
    /// \brief Default constructor
    public: Atmosphere();

    /// \brief Copy constructor
    /// \param[in] _atmosphere Atmosphere to copy.
    public: Atmosphere(const Atmosphere &_atmosphere);

    /// \brief Move constructor
    /// \param[in] _atmosphere Atmosphere to move.
    public: Atmosphere(Atmosphere &&_atmosphere) noexcept;

    /// \brief Move assignment operator.
    /// \param[in] _atmosphere Atmosphere to move.
    /// \return Reference to this.
    public: Atmosphere &operator=(Atmosphere &&_atmosphere);

    /// \brief Copy assignment operator.
    /// \param[in] _atmosphere Atmosphere to copy.
    /// \return Reference to this.
    public: Atmosphere &operator=(const Atmosphere &_atmosphere);

    /// \brief Destructor
    public: ~Atmosphere();

    /// \brief Load the atmosphere based on a element pointer. This is *not* the
    /// usual entry point. Typical usage of the SDF DOM is through the Root
    /// object.
    /// \param[in] _sdf The SDF Element pointer
    /// \return Errors, which is a vector of Error objects. Each Error includes
    /// an error code and message. An empty vector indicates no error.
    public: Errors Load(ElementPtr _sdf);

    /// \brief Get the type of the atmospheric model.
    /// \return The type of atmosphere engine, which defaults to adiabatic.
    public: AtmosphereType Type() const;

    /// \brief Set the type of the atmospheric model.
    /// \param[in] _type The type of atmosphere engine.
    public: void SetType(const AtmosphereType _type);

    /// \brief Get the temperature at sea level.
    /// \return The temperature at sea level.
    public: ignition::math::Temperature Temperature() const;

    /// \brief Set the temperature at sea level.
    /// \param[in] _temp The temperature at sea level.
    public: void SetTemperature(const ignition::math::Temperature &_temp);

    /// \brief Get the temperature gradient with respect to increasing
    /// altitude in units of K/m.
    /// \return The temperature gradient in K/m.
    public: double TemperatureGradient() const;

    /// \brief Set the temperature gradient with respect to increasing
    /// altitude in units of K/m.
    /// \param[in] _gradient The temperature gradient in K/m.
    public: void SetTemperatureGradient(const double _gradient);

    /// \brief Get the pressure at sea level in pascals.
    /// \return The pressure at sea level in pascals.
    public: double Pressure() const;

    /// \brief Set the pressure at sea level in pascals.
    /// \param[in] _pressure The pressure at sea level in pascals.
    public: void SetPressure(const double _pressure);

    /// \brief Equality operator that returns true if this atmosphere
    /// instance equals the given atmosphere instance.
    /// \param[in] _atmosphere Atmosphere instance to compare.
    /// \return True if this instance equals the given atmosphere.
    public: bool operator==(const Atmosphere &_atmosphere);

    /// \brief Private data pointer.
    private: AtmospherePrivate *dataPtr = nullptr;
  };
  }
}
#endif