Pbr.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2019 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_PBR_HH_
18 #define SDF_PBR_HH_
19 
20 #include <string>
21 #include <gz/utils/ImplPtr.hh>
22 #include "sdf/Element.hh"
23 #include "sdf/Types.hh"
24 #include "sdf/sdf_config.h"
25 #include "sdf/system_util.hh"
26 
27 namespace sdf
28 {
29  // Inline bracke to help doxygen filtering.
30  inline namespace SDF_VERSION_NAMESPACE {
31  //
32 
34  enum class PbrWorkflowType : int
35  {
37  NONE = 0,
38 
40  METAL = 1,
41 
43  SPECULAR = 2,
44  };
45 
47  enum class NormalMapSpace: int
48  {
50  TANGENT = 0,
51 
53  OBJECT = 1,
54  };
55 
59  {
61  public: PbrWorkflow();
62 
69  public: Errors Load(ElementPtr _sdf);
70 
74  public: bool operator==(const PbrWorkflow &_workflow) const;
75 
80  public: bool operator!=(const PbrWorkflow &_workflow) const;
81 
86  public: std::string AlbedoMap() const;
87 
90  public: void SetAlbedoMap(const std::string &_map);
91 
96  public: std::string NormalMap() const;
97 
102  public: void SetNormalMap(const std::string &_map,
104 
107  public: NormalMapSpace NormalMapType() const;
108 
113  public: std::string EnvironmentMap() const;
114 
117  public: void SetEnvironmentMap(const std::string &_map);
118 
123  public: std::string AmbientOcclusionMap() const;
124 
127  public: void SetAmbientOcclusionMap(const std::string &_map);
128 
133  public: std::string RoughnessMap() const;
134 
137  public: void SetRoughnessMap(const std::string &_map);
138 
143  public: std::string MetalnessMap() const;
144 
147  public: void SetMetalnessMap(const std::string &_map);
148 
153  public: std::string EmissiveMap() const;
154 
157  public: void SetEmissiveMap(const std::string &_map);
158 
163  public: std::string LightMap() const;
164 
168  public: void SetLightMap(const std::string &_map, unsigned int _uvSet = 0u);
169 
172  public: unsigned int LightMapTexCoordSet() const;
173 
176  public: double Metalness() const;
177 
180  public: void SetMetalness(const double _value);
181 
184  public: double Roughness() const;
185 
188  public: void SetRoughness(const double _value);
189 
194  public: std::string GlossinessMap() const;
195 
198  public: void SetGlossinessMap(const std::string &_map);
199 
202  public: double Glossiness() const;
203 
206  public: void SetGlossiness(const double _value);
207 
212  public: std::string SpecularMap() const;
213 
216  public: void SetSpecularMap(const std::string &_map);
217 
222  public: sdf::ElementPtr Element() const;
223 
226  public: PbrWorkflowType Type() const;
227 
230  public: void SetType(PbrWorkflowType _type);
231 
233  GZ_UTILS_IMPL_PTR(dataPtr)
234  };
235 
239  {
241  public: Pbr();
242 
249  public: Errors Load(ElementPtr _sdf);
250 
255  public: void SetWorkflow(PbrWorkflowType _type,
256  const PbrWorkflow &_workflow);
257 
262  public: const PbrWorkflow *Workflow(PbrWorkflowType _type) const;
263 
265  GZ_UTILS_IMPL_PTR(dataPtr)
266  };
267  }
268 }
269 #endif
sdf::SDF_VERSION_NAMESPACE::PbrWorkflowType::NONE
@ NONE
No workflow.
sdf::SDF_VERSION_NAMESPACE::Pbr
This class provides access to Physically-Based-Rendering (PBR) material workflows.
Definition: Pbr.hh:238
sdf::SDF_VERSION_NAMESPACE::NormalMapSpace::TANGENT
@ TANGENT
Tangent space.
sdf
namespace for Simulation Description Format parser
Definition: Actor.hh:34
sdf::SDF_VERSION_NAMESPACE::PbrWorkflowType
PbrWorkflowType
Type of PBR workflow.
Definition: Pbr.hh:34
sdf::SDF_VERSION_NAMESPACE::NormalMapSpace
NormalMapSpace
Space the normal map is defined in.
Definition: Pbr.hh:47
sdf::SDF_VERSION_NAMESPACE::NormalMapSpace::OBJECT
@ OBJECT
Object space.
Types.hh
sdf_config.h
SDFORMAT_VISIBLE
#define SDFORMAT_VISIBLE
Definition: system_util.hh:25
sdf::SDF_VERSION_NAMESPACE::PbrWorkflow
This class contains Physically-Based-Rendering (PBR) workflow properties.
Definition: Pbr.hh:58
sdf::SDF_VERSION_NAMESPACE::PbrWorkflowType::SPECULAR
@ SPECULAR
Specular/Glossiness workflow.
sdf::SDF_VERSION_NAMESPACE::Element
class GZ_SDFORMAT_VISIBLE Element
Definition: Element.hh:51
sdf::SDF_VERSION_NAMESPACE::Errors
std::vector< Error > Errors
A vector of Error.
Definition: Types.hh:80
system_util.hh
sdf::SDF_VERSION_NAMESPACE::PbrWorkflowType::METAL
@ METAL
Metal/Roughness workflow.
sdf::SDF_VERSION_NAMESPACE::ElementPtr
std::shared_ptr< Element > ElementPtr
Definition: Element.hh:55
Element.hh