OgreOverlay.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4  (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2013 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 
29 #ifndef __Overlay_H__
30 #define __Overlay_H__
31 
33 #include "OgreSceneNode.h"
34 #include "OgreIteratorWrappers.h"
35 #include "OgreMatrix4.h"
36 
37 namespace Ogre {
38 
39 
71  {
72 
73  public:
75  protected:
83 
87  Real mScrollX, mScrollY;
89  Real mScaleX, mScaleY;
90 
92  mutable bool mTransformOutOfDate;
95  bool mVisible;
99  void updateTransform(void) const;
101  void initialise(void);
103  void assignZOrders(void);
104 
105  public:
107  Overlay(const String& name);
108  virtual ~Overlay();
109 
110 
111  OverlayContainer* getChild(const String& name);
112 
114  const String& getName(void) const;
115 
120  void setZOrder(ushort zorder);
122  ushort getZOrder(void) const;
123 
125  bool isVisible(void) const;
126 
128  bool isInitialised(void) const { return mInitialised; }
129 
131  void show(void);
132 
134  void hide(void);
135 
146  void add2D(OverlayContainer* cont);
147 
148 
153  void remove2D(OverlayContainer* cont);
154 
187  void add3D(SceneNode* node);
188 
190  void remove3D(SceneNode* node);
191 
193  void clear();
194 
204  void setScroll(Real x, Real y);
205 
207  Real getScrollX(void) const;
208 
210  Real getScrollY(void) const;
211 
218  void scroll(Real xoff, Real yoff);
219 
221  void setRotate(const Radian& angle);
222 
224  const Radian &getRotate(void) const { return mRotate; }
225 
227  void rotate(const Radian& angle);
228 
236  void setScale(Real x, Real y);
237 
239  Real getScaleX(void) const;
240 
242  Real getScaleY(void) const;
243 
245  void _getWorldTransforms(Matrix4* xform) const;
246 
248  void _findVisibleObjects(Camera* cam, RenderQueue* queue);
249 
251  virtual OverlayElement* findElementAt(Real x, Real y);
252 
259  {
260  return Overlay2DElementsIterator (m2DElements.begin(), m2DElements.end());
261  }
268  const String& getOrigin(void) const { return mOrigin; }
270  void _notifyOrigin(const String& origin) { mOrigin = origin; }
271 
272 
273  };
277 }
278 
279 
280 #endif
281 
Ogre::Overlay::getOrigin
const String & getOrigin(void) const
Get the origin of this overlay, e.g.
Definition: OgreOverlay.h:268
Ogre::Overlay::mVisible
bool mVisible
Definition: OgreOverlay.h:95
Ogre::OverlayElement
Abstract definition of a 2D element to be displayed in an Overlay.
Definition: OgreOverlayElement.h:108
Ogre::AllocatedObject
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Definition: OgreMemoryAllocatedObject.h:58
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::Overlay::Overlay2DElementsIterator
VectorIterator< OverlayContainerList > Overlay2DElementsIterator
Returns an iterator over all 2D elements in this manager.
Definition: OgreOverlay.h:257
Ogre::Overlay::mScrollY
Real mScrollY
Definition: OgreOverlay.h:87
Ogre::ushort
unsigned short ushort
Definition: OgrePrerequisites.h:113
Ogre::Camera
A viewpoint from which the scene will be rendered.
Definition: OgreCamera.h:86
OgreOverlayPrerequisites.h
Ogre::Overlay::mTransformOutOfDate
bool mTransformOutOfDate
Definition: OgreOverlay.h:92
Ogre::Overlay::mTransformUpdated
bool mTransformUpdated
Definition: OgreOverlay.h:93
Ogre::VectorIterator
Concrete IteratorWrapper for nonconst access to the underlying container.
Definition: OgreIteratorWrapper.h:186
Ogre::Overlay::isInitialised
bool isInitialised(void) const
Gets whether the overlay is initialised or not.
Definition: OgreOverlay.h:128
Ogre::Overlay::mTransform
Matrix4 mTransform
Definition: OgreOverlay.h:91
Ogre::Overlay::mZOrder
ulong mZOrder
Definition: OgreOverlay.h:94
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::Overlay::get2DElementsIterator
Overlay2DElementsIterator get2DElementsIterator()
Definition: OgreOverlay.h:258
Ogre::SceneNode
Class representing a node in the scene graph.
Definition: OgreSceneNode.h:58
Ogre::Matrix4
Class encapsulating a standard 4x4 homogeneous matrix.
Definition: OgreMatrix4.h:78
Ogre::list
Definition: OgrePrerequisites.h:505
Ogre::Overlay::m2DElements
OverlayContainerList m2DElements
2D elements OverlayContainers, linked list for easy sorting by zorder later Not a map because sort ca...
Definition: OgreOverlay.h:82
_OgreOverlayExport
#define _OgreOverlayExport
Definition: OgreOverlayPrerequisites.h:58
Ogre::Radian
Wrapper class which indicates a given angle value is in Radians.
Definition: OgreMath.h:47
Ogre::Overlay::getRotate
const Radian & getRotate(void) const
Gets the rotation applied to this overlay, in degrees.
Definition: OgreOverlay.h:224
OgreSceneNode.h
Ogre::ulong
unsigned long ulong
Definition: OgrePrerequisites.h:115
OgreIteratorWrappers.h
Ogre::Overlay::mScaleY
Real mScaleY
Definition: OgreOverlay.h:89
OgreMatrix4.h
Ogre::Overlay::OverlayContainerList
list< OverlayContainer * >::type OverlayContainerList
Definition: OgreOverlay.h:74
Ogre::Overlay::mRotate
Radian mRotate
Degrees of rotation around center.
Definition: OgreOverlay.h:85
Ogre::Overlay::mOrigin
String mOrigin
Definition: OgreOverlay.h:97
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
Ogre::Overlay::mRootNode
SceneNode * mRootNode
Internal root node, used as parent for 3D objects.
Definition: OgreOverlay.h:78
Ogre::Overlay::mName
String mName
Definition: OgreOverlay.h:76
Ogre::Overlay::_notifyOrigin
void _notifyOrigin(const String &origin)
Notify this overlay of it's origin.
Definition: OgreOverlay.h:270
Ogre::Overlay
Represents a layer which is rendered on top of the 'normal' scene contents.
Definition: OgreOverlay.h:70
Ogre::RenderQueue
Class to manage the scene object rendering queue.
Definition: OgreRenderQueue.h:92
Ogre::Overlay::mInitialised
bool mInitialised
Definition: OgreOverlay.h:96
Ogre::OverlayContainer
A 2D element which contains other OverlayElement instances.
Definition: OgreOverlayContainer.h:56

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Tue Apr 13 2021 08:53:15