Ogre2GlobalIlluminationCiVct.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2022 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 GZ_RENDERING_OGRE2_OGRE2GLOBALILLUMINATIONCIVCT_HH_
18 #define GZ_RENDERING_OGRE2_OGRE2GLOBALILLUMINATIONCIVCT_HH_
19 
21 
22 #include "gz/rendering/ogre2/Export.hh"
24 
25 #include <memory>
26 
27 #ifdef _MSC_VER
28  #pragma warning(push)
29  // Suppress dll-interface warning. This should no longer be needed in
30  // gz-rendering9 as visibility changed hidden by default.
31  #pragma warning(disable:4251)
32 #endif
33 
34 namespace Ogre
35 {
36  class HlmsPbs;
37  class VctCascadeSetting;
38 }
39 
40 namespace gz
41 {
42  namespace rendering
43  {
44  inline namespace GZ_RENDERING_VERSION_NAMESPACE {
45  //
46  // forward declaration
47  class Ogre2CiVctCascadePrivate;
48  class Ogre2GlobalIlluminationCiVctPrivate;
49 
51  class GZ_RENDERING_OGRE2_VISIBLE Ogre2CiVctCascade :
52  public virtual CiVctCascade
53  {
55  public: explicit Ogre2CiVctCascade();
56 
57  public: ~Ogre2CiVctCascade() override;
58 
62  public: void Init(Ogre::VctCascadeSetting *_cascade,
63  const CiVctCascade *_ref);
64 
68  public: void ReInit(Ogre::VctCascadeSetting *_cascade);
69 
70  // Documentation inherited.
71  public: virtual void SetCorrectAreaLightShadows(
72  bool _correctAreaLightShadows) override;
73 
74  // Documentation inherited.
75  public: virtual bool CorrectAreaLightShadows() const override;
76 
77  // Documentation inherited.
78  public: virtual void SetAutoMultiplier(bool _autoMultiplier) override;
79 
80  // Documentation inherited.
81  public: virtual bool AutoMultiplier() const override;
82 
83  // Documentation inherited.
84  public: virtual void SetThinWallCounter(float _thinWallCounter) override;
85 
86  // Documentation inherited.
87  public: virtual float ThinWallCounter() const override;
88 
89  // Documentation inherited.
90  public: virtual void SetResolution(const uint32_t _resolution[3])
91  override;
92 
93  // Documentation inherited.
94  public: virtual const uint32_t* Resolution() const override;
95 
96  // Documentation inherited.
97  public: virtual void SetOctantCount(const uint32_t _octants[3]) override;
98 
99  // Documentation inherited.
100  public: virtual const uint32_t* OctantCount() const override;
101 
102  // Documentation inherited.
103  public: virtual void SetAreaHalfSize(
104  const gz::math::Vector3d &_areaHalfSize) override;
105 
106  // Documentation inherited.
107  public: virtual gz::math::Vector3d AreaHalfSize() const override;
108 
109  // Documentation inherited.
110  public: virtual void SetCameraStepSize(
111  const gz::math::Vector3d &_stepSize) override;
112 
113  // Documentation inherited.
114  public: virtual gz::math::Vector3d CameraStepSize() const override;
115 
118  };
119 
121  class GZ_RENDERING_OGRE2_VISIBLE Ogre2GlobalIlluminationCiVct :
122  public virtual GlobalIlluminationCiVct, public virtual Ogre2Object
123  {
126 
128  public: virtual ~Ogre2GlobalIlluminationCiVct() override;
129 
130  // Documentation inherited
131  protected: virtual void Init() override;
132 
133  // Documentation inherited
134  public: virtual void Destroy() override;
135 
136  // Documentation inherited
137  public: virtual void Build() override;
138 
139  // Documentation inherited
140  public: virtual void UpdateLighting() override;
141 
142  // Documentation inherited
143  public: virtual void UpdateCamera() override;
144 
145  // Documentation inherited
146  public: virtual void SetMaxCascades(const uint32_t _maxCascades) override;
147 
148  // Documentation inherited
149  public: virtual CiVctCascadePtr AddCascade(
150  const CiVctCascade* _ref) override;
151 
152  // Documentation inherited
153  public: virtual void PopCascade() override;
154 
155  // Documentation inherited
156  public: virtual void AutoCalculateStepSizes(
157  const gz::math::Vector3d &_stepSize) override;
158 
159  // Documentation inherited.
160  public: virtual void SetConsistentCascadeSteps(
161  bool _consistentCascadeSteps) override;
162 
163  // Documentation inherited.
164  public: virtual bool ConsistentCascadeSteps() const override;
165 
166  // Documentation inherited.
167  public: virtual bool Started() const override;
168 
169  // Documentation inherited
170  public: virtual void Start(
171  uint32_t _bounceCount, bool _anisotropic) override;
172 
173  // Documentation inherited
174  public: virtual void NewSettings(
175  uint32_t _bounceCount, bool _anisotropic) override;
176 
177  // Documentation inherited
178  public: virtual void Reset() override;
179 
180  // Documentation inherited
181  public: virtual void Bind(const CameraPtr &_camera) override;
182 
183  // Documentation inherited
184  public: virtual bool Anisotropic() const override;
185 
186  // Documentation inherited
187  public: virtual void SetHighQuality(bool _highQuality) override;
188 
189  // Documentation inherited
190  public: virtual bool HighQuality() const override;
191 
195  protected: virtual void SetEnabled(bool _enabled) override;
196 
197  // Documentation inherited.
198  public: virtual bool Enabled() const override;
199 
200  // Documentation inherited.
201  public: virtual void SetDebugVisualization(
202  DebugVisualizationMode _dvm) override;
203 
204  // Documentation inherited.
206  override;
207 
208  // Documentation inherited.
209  public: virtual void LightingChanged() override;
210 
211  // Documentation inherited.
212  public: virtual void SetBounceCount(uint32_t _bounceCount) override;
213 
214  // Documentation inherited.
215  public: virtual uint32_t BounceCount() const override;
216 
217  // Documentation inherited.
218  public: void SetParticipatingVisuals(uint32_t _mask) override;
219 
220  // Documentation inherited.
221  public: uint32_t ParticipatingVisuals() const override;
222 
225  private: Ogre::HlmsPbs* HlmsPbs() const;
226 
229  private: void SyncModeVisualizationMode();
230 
233 
235  private: friend class Ogre2Scene;
236  };
237  }
238  }
239 }
240 
241 #ifdef _MSC_VER
242  #pragma warning(pop)
243 #endif
244 
245 #endif