Ignition Rendering

API Reference

0.1.0
OgreRenderTarget.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 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 IGNITION_RENDERING_OGRE_OGRERENDERTARGET_HH_
18 #define IGNITION_RENDERING_OGRE_OGRERENDERTARGET_HH_
19 
20 #include <ignition/math/Color.hh>
21 
27 
28 namespace Ogre
29 {
30  class Camera;
31  class RenderTarget;
32  class Texture;
33 }
34 
35 namespace ignition
36 {
37  namespace rendering
38  {
39  class IGNITION_RENDERING_OGRE_VISIBLE OgreRenderTarget :
40  public virtual BaseRenderTarget<OgreObject>
41  {
42  protected: OgreRenderTarget();
43 
44  public: virtual ~OgreRenderTarget();
45 
46  public: virtual unsigned int AntiAliasing() const;
47 
48  public: virtual void SetAntiAliasing(unsigned int _aa);
49 
50  public: virtual void Copy(Image &_image) const;
51 
52  public: virtual Ogre::Camera *Camera() const;
53 
54  public: virtual void SetCamera(Ogre::Camera *_camera);
55 
56  // Documentation inherited
57  public: virtual math::Color BackgroundColor() const;
58 
59  public: virtual void SetBackgroundColor(math::Color _color);
60 
61  public: virtual void PreRender();
62 
63  public: virtual void Render();
64 
65  public: virtual void Destroy() = 0;
66 
67  protected: virtual Ogre::RenderTarget *RenderTarget() const = 0;
68 
69  protected: virtual void UpdateBackgroundColor();
70 
71  protected: virtual void RebuildImpl();
72 
73  protected: virtual void RebuildTarget() = 0;
74 
75  protected: virtual void RebuildViewport();
76 
77  protected: Ogre::Camera *ogreCamera = nullptr;
78 
79  protected: Ogre::Viewport *ogreViewport = nullptr;
80 
82 
83  protected: bool colorDirty = true;
84 
85  protected: unsigned int antiAliasing = 4;
86  };
87 
88  class IGNITION_RENDERING_OGRE_VISIBLE OgreRenderTexture :
89  public virtual BaseRenderTexture<OgreRenderTarget>
90  {
91  protected: OgreRenderTexture();
92 
93  public: virtual ~OgreRenderTexture();
94 
95  public: virtual void Destroy();
96 
97  protected: virtual Ogre::RenderTarget *RenderTarget() const;
98 
99  protected: virtual void RebuildTarget();
100 
101  protected: virtual void DestroyTarget();
102 
103  protected: virtual void BuildTarget();
104 
105  protected: Ogre::Texture *ogreTexture = nullptr;
106 
107  private: friend class OgreScene;
108  };
109 
110  class IGNITION_RENDERING_OGRE_VISIBLE OgreRenderWindow :
111  public virtual BaseRenderWindow<OgreRenderTarget>
112  {
113  protected: OgreRenderWindow();
114 
115  public: virtual ~OgreRenderWindow();
116 
117  public: virtual void Destroy();
118 
119  protected: virtual Ogre::RenderTarget *RenderTarget() const;
120 
121  protected: virtual void RebuildTarget();
122 
123  protected: virtual void BuildTarget();
124 
125  protected: Ogre::RenderTarget *ogreRenderWindow = nullptr;
126 
127  private: friend class OgreScene;
128  };
129 
130  }
131 }
132 #endif
Definition: BaseRenderTarget.hh:70
Ogre::ColourValue ogreBackgroundColor
Definition: OgreRenderTarget.hh:81
Definition: BaseRenderTarget.hh:31
Definition: OgreRenderTarget.hh:110
Represents a render-target to which cameras can render images.
Definition: RenderTarget.hh:34
Definition: BaseRenderTarget.hh:80
Encapsulates a raw image buffer and relevant properties.
Definition: Image.hh:30
Definition: OgreRenderTarget.hh:39
Posable camera used for rendering the scene graph.
Definition: Camera.hh:35
Definition: OgreScene.hh:34
Definition: OgreRenderTarget.hh:88
Definition: ArrowVisual.hh:22