Gazebo Rendering

API Reference

3.7.2
gz/rendering/ShaderParam.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 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 
18 #ifndef GZ_RENDERING_SHADERPARAM_HH_
19 #define GZ_RENDERING_SHADERPARAM_HH_
20 
21 #include <cstdint>
22 #include <memory>
23 
24 #include <gz/common/SuppressWarning.hh>
25 
26 #include "gz/rendering/config.hh"
27 #include "gz/rendering/Export.hh"
28 
29 namespace ignition
30 {
31  namespace rendering
32  {
33  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
34  //
36  class ShaderParamPrivate;
37 
39  class IGNITION_RENDERING_VISIBLE ShaderParam
40  {
41  public: enum ParamType : uint16_t
42  {
44  PARAM_NONE = 0,
45 
47  PARAM_FLOAT = 1,
48 
50  PARAM_INT = 2,
51  };
52 
54  public: ShaderParam();
55 
58  public: ShaderParam(const ShaderParam &_other);
59 
61  public: ~ShaderParam();
62 
65  public: ParamType Type() const;
66 
70  public: ShaderParam &operator=(const ShaderParam &_other);
71 
74  public: void operator=(const float _value);
75 
78  public: void operator=(const int _value);
79 
83  public: bool Value(float *_value) const;
84 
88  public: bool Value(int *_value) const;
89 
92  private: std::unique_ptr<ShaderParamPrivate> dataPtr;
94  };
95  }
96  }
97 }
98 
99 #endif
#define IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
bool Value(float *_value) const
Get the value of this parameter if it is a float.
ParamType Type() const
Get the type of this parameter.
ParamType
Definition: gz/rendering/ShaderParam.hh:41
@ PARAM_NONE
Type none.
Definition: gz/rendering/ShaderParam.hh:44
a variant type that holds params that can be passed to a shader
Definition: gz/rendering/ShaderParam.hh:39
ShaderParam & operator=(const ShaderParam &_other)
Set from another ShaderParam.
@ PARAM_INT
Integer type param.
Definition: gz/rendering/ShaderParam.hh:50
#define IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
@ PARAM_FLOAT
Float type param.
Definition: gz/rendering/ShaderParam.hh:47