Gazebo Rendering

API Reference

6.6.3
gz/rendering/ShaderParams.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_SHADERPARAMS_HH_
19 #define GZ_RENDERING_SHADERPARAMS_HH_
20 
21 #include <memory>
22 #include <string>
23 #include <utility>
24 
25 #include "gz/rendering/Export.hh"
27 
28 namespace ignition
29 {
30  namespace rendering
31  {
32  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
33  //
35  class ShaderParamsPrivate;
36 
38  class IGNITION_RENDERING_VISIBLE ShaderParams
39  {
41  class IteratorPrivate;
42 
45  class IGNITION_RENDERING_VISIBLE Iterator
46  {
48  public: Iterator();
49 
52  public: explicit Iterator(std::unique_ptr<IteratorPrivate> _dataPtr);
53 
56  public: Iterator(const Iterator &_iter);
57 
61  Iterator& operator=(const Iterator &_iter);
62 
64  public: ~Iterator();
65 
69  public: bool operator==(const Iterator &_iter);
70 
75  public: bool operator!=(const Iterator &_iter);
76 
78  public: const std::pair<const std::string, ShaderParam> &operator*();
79 
81  public: const std::pair<const std::string, ShaderParam> *operator->();
82 
84  public: Iterator &operator++();
85 
87  public: Iterator operator++(int);
88 
89  private: std::unique_ptr<IteratorPrivate> dataPtr;
90  };
91 
93  public: ShaderParams();
94 
96  public: ~ShaderParams();
97 
101  public: ShaderParam &operator[](const std::string &_name);
102 
106  public: const ShaderParam &operator[](const std::string &_name) const;
107 
111  public: Iterator begin() const;
112 
116  public: Iterator end() const;
117 
121  public: bool IsDirty() const;
122 
125  public: void ClearDirty();
126 
128  private: std::unique_ptr<ShaderParamsPrivate> dataPtr;
129  };
130  }
131  }
132 }
133 
134 #endif
STL class.
Iterator end() const
Iterator to one past last param.
a map that holds params to be passed to a shader
Definition: gz/rendering/ShaderParams.hh:38
a variant type that holds params that can be passed to a shader
Definition: gz/rendering/ShaderParam.hh:41
bool IsDirty() const
Have the params changed?
void ClearDirty()
Resets the dirty flag.
ShaderParam & operator[](const std::string &_name)
Access a param with a given name.
Iterator begin() const
Iterator to first parameter.