Sky.hh
Go to the documentation of this file.
1/*
2 * Copyright 2020 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
18#ifndef SDF_SKY_HH_
19#define SDF_SKY_HH_
20
21#include <string>
22
23#include <gz/math/Color.hh>
24#include <gz/utils/ImplPtr.hh>
25
26#include "sdf/Element.hh"
27#include "sdf/Types.hh"
28#include "sdf/sdf_config.h"
29#include "sdf/system_util.hh"
30
31namespace sdf
32{
33 // Inline bracket to help doxygen filtering.
34 inline namespace SDF_VERSION_NAMESPACE {
35 //
36
37 // Forward declarations.
38 class ParserConfig;
39
41 {
43 public: Sky();
44
47 public: double Time() const;
48
51 public: void SetTime(double _time);
52
55 public: double Sunrise() const;
56
59 public: void SetSunrise(double _time);
60
63 public: double Sunset() const;
64
67 public: void SetSunset(double _time);
68
71 public: double CloudSpeed() const;
72
75 public: void SetCloudSpeed(double _speed);
76
79 public: gz::math::Angle CloudDirection() const;
80
83 public: void SetCloudDirection(const gz::math::Angle &_angle);
84
87 public: double CloudHumidity() const;
88
91 public: void SetCloudHumidity(double _humidity);
92
95 public: double CloudMeanSize() const;
96
99 public: void SetCloudMeanSize(double _size);
100
103 public: gz::math::Color CloudAmbient() const;
104
107 public: void SetCloudAmbient(const gz::math::Color &_ambient);
108
111 public: const std::string &CubemapUri() const;
112
115 public: void SetCubemapUri(const std::string &_uri);
116
123 public: Errors Load(ElementPtr _sdf);
124
131 public: Errors Load(ElementPtr _sdf, const ParserConfig &_config);
132
137 public: sdf::ElementPtr Element() const;
138
144 public: sdf::ElementPtr ToElement() const;
145
152 public: sdf::ElementPtr ToElement(sdf::Errors &_errors) const;
153
155 GZ_UTILS_IMPL_PTR(dataPtr)
156 };
157 }
158}
159#endif
This class contains configuration options for the libsdformat parser.
Definition: ParserConfig.hh:100
Definition: Sky.hh:41
void SetSunset(double _time)
Set Sunset time.
const std::string & CubemapUri() const
Get the skybox texture URI.
void SetCloudDirection(const gz::math::Angle &_angle)
Set cloud direction angle (angle around up axis)
void SetCubemapUri(const std::string &_uri)
Set the skybox texture URI.
double Sunset() const
Get sunset time.
sdf::ElementPtr ToElement() const
Create and return an SDF element filled with data from this sky.
Errors Load(ElementPtr _sdf, const ParserConfig &_config)
Load the sky based on a element pointer.
void SetSunrise(double _time)
Set Sunrise time.
double CloudSpeed() const
Get cloud speed.
double Sunrise() const
Get sunrise time.
sdf::ElementPtr Element() const
Get a pointer to the SDF element that was used during load.
void SetTime(double _time)
Set time of day.
double CloudMeanSize() const
Get cloud mean size.
gz::math::Color CloudAmbient() const
Get cloud ambient color.
void SetCloudMeanSize(double _size)
Set cloud mean siz.
Sky()
Default constructor.
void SetCloudHumidity(double _humidity)
Set cloud humidity.
Errors Load(ElementPtr _sdf)
Load the sky based on a element pointer.
sdf::ElementPtr ToElement(sdf::Errors &_errors) const
Create and return an SDF element filled with data from this sky.
void SetCloudAmbient(const gz::math::Color &_ambient)
Set cloud ambient color.
double CloudHumidity() const
Get cloud humidity.
gz::math::Angle CloudDirection() const
Get cloud direction angle (angle around up axis)
void SetCloudSpeed(double _speed)
Set cloud speed.
double Time() const
Get time of day [0..24].
std::vector< Error > Errors
A vector of Error.
Definition: Types.hh:95
std::shared_ptr< Element > ElementPtr
Definition: Element.hh:55
namespace for Simulation Description Format parser
Definition: Actor.hh:35
#define SDFORMAT_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system_util.hh:25