Gazebo Rendering

API Reference

6.6.3
gz/rendering/ogre2/Ogre2RenderTargetMaterial.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 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_OGRE2RENDERTARGETMATERIAL_HH_
18 #define GZ_RENDERING_OGRE2_OGRE2RENDERTARGETMATERIAL_HH_
19 
20 #include <vector>
21 
22 #include "gz/rendering/config.hh"
23 #include "gz/rendering/ogre2/Export.hh"
24 
25 #ifdef _MSC_VER
26  #pragma warning(push, 0)
27 #endif
28 #include <OgreCamera.h>
29 #include <OgreMaterialManager.h>
30 #ifdef _MSC_VER
31  #pragma warning(pop)
32 #endif
33 
34 #ifdef _MSC_VER
35  #pragma warning(push)
36  // Silence deriving from Ogre::RenderTargetListener dll-linkage warnings
37  #pragma warning(disable:4275)
38 #endif
39 
40 namespace ignition
41 {
42  namespace rendering
43  {
44  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
45  //
58  class IGNITION_RENDERING_OGRE2_VISIBLE Ogre2RenderTargetMaterial :
59  public Ogre::Camera::Listener,
60  public Ogre::MaterialManager::Listener
61  {
66  public: Ogre2RenderTargetMaterial(Ogre::SceneManager *_scene,
67  Ogre::Camera *_renderTarget, Ogre::Material *_material);
68 
70  public: ~Ogre2RenderTargetMaterial();
71 
74  private: virtual void cameraPreRenderScene(
75  Ogre::Camera *_cam) override;
76 
79  private: virtual void cameraPostRenderScene(
80  Ogre::Camera *_evt) override;
81 
92  public: virtual Ogre::Technique *handleSchemeNotFound(
93  uint16_t _schemeIndex, const Ogre::String &_schemeName,
94  Ogre::Material *_originalMaterial, uint16_t _lodIndex,
95  const Ogre::Renderable *_rend) override;
96 
98  private: Ogre::SceneManager *scene = nullptr;
99 
101  private: Ogre::Camera *renderCamera = nullptr;
102 
104  private: Ogre::Material *material = nullptr;
105 
107  private: Ogre::String schemeName;
108  };
109  }
110  }
111 }
112 
113 #ifdef _MSC_VER
114  #pragma warning(pop)
115 #endif
116 
117 #endif
Causes all objects in a scene to be rendered with the same material when rendered by a given RenderTa...
Definition: gz/rendering/ogre2/Ogre2RenderTargetMaterial.hh:58