OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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-2014 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 "OgreIteratorWrappers.h"
34 #include "OgreMatrix4.h"
35 
36 namespace Ogre {
37 
38 
70  {
71 
72  public:
74  protected:
82 
86  Real mScrollX, mScrollY;
88  Real mScaleX, mScaleY;
89 
91  mutable bool mTransformOutOfDate;
94  bool mVisible;
98  void updateTransform(void) const;
100  void initialise(void);
102  void assignZOrders(void);
103 
104  public:
106  Overlay(const String& name);
107  virtual ~Overlay();
108 
109 
110  OverlayContainer* getChild(const String& name);
111 
113  const String& getName(void) const;
114 
119  void setZOrder(ushort zorder);
121  ushort getZOrder(void) const;
122 
124  bool isVisible(void) const;
125 
127  bool isInitialised(void) const { return mInitialised; }
128 
130  void show(void);
131 
133  void hide(void);
134 
145  void add2D(OverlayContainer* cont);
146 
147 
152  void remove2D(OverlayContainer* cont);
153 
186  void add3D(SceneNode* node);
187 
189  void remove3D(SceneNode* node);
190 
192  void clear();
193 
203  void setScroll(Real x, Real y);
204 
206  Real getScrollX(void) const;
207 
209  Real getScrollY(void) const;
210 
217  void scroll(Real xoff, Real yoff);
218 
220  void setRotate(const Radian& angle);
221 
223  const Radian &getRotate(void) const { return mRotate; }
224 
226  void rotate(const Radian& angle);
227 
235  void setScale(Real x, Real y);
236 
238  Real getScaleX(void) const;
239 
241  Real getScaleY(void) const;
242 
244  void _getWorldTransforms(Matrix4* xform) const;
245 
247  void _findVisibleObjects(Camera* cam, RenderQueue* queue);
248 
250  virtual OverlayElement* findElementAt(Real x, Real y);
251 
258  {
259  return Overlay2DElementsIterator (m2DElements.begin(), m2DElements.end());
260  }
267  const String& getOrigin(void) const { return mOrigin; }
269  void _notifyOrigin(const String& origin) { mOrigin = origin; }
270 
271 
272  };
276 }
277 
278 
279 #endif
280 
A viewpoint from which the scene will be rendered.
Definition: OgreCamera.h:82
Class encapsulating a standard 4x4 homogeneous matrix.
Definition: OgreMatrix4.h:79
float Real
Software floating point type.
Overlay2DElementsIterator get2DElementsIterator()
Definition: OgreOverlay.h:257
unsigned long ulong
#define _OgreOverlayExport
String mName
Definition: OgreOverlay.h:75
Radian mRotate
Degrees of rotation around center.
Definition: OgreOverlay.h:84
list< OverlayContainer * >::type OverlayContainerList
Definition: OgreOverlay.h:73
bool mInitialised
Definition: OgreOverlay.h:95
VectorIterator< OverlayContainerList > Overlay2DElementsIterator
Returns an iterator over all 2D elements in this manager.
Definition: OgreOverlay.h:256
A 2D element which contains other OverlayElement instances.
OverlayContainerList m2DElements
2D elements OverlayContainers, linked list for easy sorting by zorder later Not a map because sort ca...
Definition: OgreOverlay.h:81
Class representing a node in the scene graph.
Definition: OgreSceneNode.h:53
void _notifyOrigin(const String &origin)
Notify this overlay of it's origin.
Definition: OgreOverlay.h:269
SceneNode * mRootNode
Internal root node, used as parent for 3D objects.
Definition: OgreOverlay.h:77
bool mTransformOutOfDate
Definition: OgreOverlay.h:91
bool mTransformUpdated
Definition: OgreOverlay.h:92
Matrix4 mTransform
Definition: OgreOverlay.h:90
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
const Radian & getRotate(void) const
Gets the rotation applied to this overlay, in degrees.
Definition: OgreOverlay.h:223
unsigned short ushort
Abstract definition of a 2D element to be displayed in an Overlay.
Wrapper class which indicates a given angle value is in Radians.
Definition: OgreMath.h:49
Class to manage the scene object rendering queue.
_StringBase String
Definition: OgreCommon.h:53
bool isInitialised(void) const
Gets whether the overlay is initialised or not.
Definition: OgreOverlay.h:127
const String & getOrigin(void) const
Get the origin of this overlay, e.g.
Definition: OgreOverlay.h:267
Concrete IteratorWrapper for nonconst access to the underlying container.
Represents a layer which is rendered on top of the 'normal' scene contents.
Definition: OgreOverlay.h:69
String mOrigin
Definition: OgreOverlay.h:96