OgreOverlay.h
Go to the documentation of this file.
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2013 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------------------------------------------------------------------------
*/
#ifndef __Overlay_H__
#define __Overlay_H__
#include "OgreOverlayPrerequisites.h"
#include "OgreSceneNode.h"
#include "OgreIteratorWrappers.h"
#include "OgreMatrix4.h"
namespace Ogre {
class _OgreOverlayExport Overlay : public OverlayAlloc
{
public:
typedef list<OverlayContainer*>::type OverlayContainerList;
protected:
String mName;
SceneNode* mRootNode;
OverlayContainerList m2DElements;
Radian mRotate;
Real mScrollX, mScrollY;
Real mScaleX, mScaleY;
mutable Matrix4 mTransform;
mutable bool mTransformOutOfDate;
bool mTransformUpdated;
ulong mZOrder;
bool mVisible;
bool mInitialised;
String mOrigin;
void updateTransform(void) const;
void initialise(void);
void assignZOrders(void);
public:
Overlay(const String& name);
virtual ~Overlay();
OverlayContainer* getChild(const String& name);
const String& getName(void) const;
void setZOrder(ushort zorder);
ushort getZOrder(void) const;
bool isVisible(void) const;
bool isInitialised(void) const { return mInitialised; }
void show(void);
void hide(void);
void add2D(OverlayContainer* cont);
void remove2D(OverlayContainer* cont);
void add3D(SceneNode* node);
void remove3D(SceneNode* node);
void clear();
void setScroll(Real x, Real y);
Real getScrollX(void) const;
Real getScrollY(void) const;
void scroll(Real xoff, Real yoff);
void setRotate(const Radian& angle);
const Radian &getRotate(void) const { return mRotate; }
void rotate(const Radian& angle);
void setScale(Real x, Real y);
Real getScaleX(void) const;
Real getScaleY(void) const;
void _getWorldTransforms(Matrix4* xform) const;
void _findVisibleObjects(Camera* cam, RenderQueue* queue);
virtual OverlayElement* findElementAt(Real x, Real y);
typedef VectorIterator<OverlayContainerList> Overlay2DElementsIterator ;
Overlay2DElementsIterator get2DElementsIterator ()
{
return Overlay2DElementsIterator (m2DElements.begin(), m2DElements.end());
}
const String& getOrigin(void) const { return mOrigin; }
void _notifyOrigin(const String& origin) { mOrigin = origin; }
};
}
#endif
Ogre::VectorIterator
Concrete IteratorWrapper for nonconst access to the underlying container.
Definition: OgreIteratorWrapper.h:186
Ogre::Overlay::_notifyOrigin
void _notifyOrigin(const String &origin)
Notify this overlay of it&#39;s origin.
Definition: OgreOverlay.h:270
Ogre::list
Definition: OgrePrerequisites.h:505
Ogre::Overlay::mScaleY
Real mScaleY
Definition: OgreOverlay.h:89
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
Ogre::RenderQueue
Class to manage the scene object rendering queue.
Definition: OgreRenderQueue.h:92
Ogre::Overlay::getRotate
const Radian & getRotate(void) const
Gets the rotation applied to this overlay, in degrees.
Definition: OgreOverlay.h:224
_OgreOverlayExport
#define _OgreOverlayExport
Definition: OgreOverlayPrerequisites.h:58
Ogre::Overlay::mTransformUpdated
bool mTransformUpdated
Definition: OgreOverlay.h:93
Ogre::SceneNode
Class representing a node in the scene graph.
Definition: OgreSceneNode.h:58
Ogre::Overlay::mInitialised
bool mInitialised
Definition: OgreOverlay.h:96
Ogre::Overlay::getOrigin
const String & getOrigin(void) const
Get the origin of this overlay, e.g.
Definition: OgreOverlay.h:268
Ogre::Overlay::mRootNode
SceneNode * mRootNode
Internal root node, used as parent for 3D objects.
Definition: OgreOverlay.h:78
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
Ogre::Matrix4
Class encapsulating a standard 4x4 homogeneous matrix.
Definition: OgreMatrix4.h:78
Ogre::Overlay::Overlay2DElementsIterator
VectorIterator< OverlayContainerList > Overlay2DElementsIterator
Returns an iterator over all 2D elements in this manager.
Definition: OgreOverlay.h:257
Ogre::Overlay::mRotate
Radian mRotate
Degrees of rotation around center.
Definition: OgreOverlay.h:85
OgreMatrix4.h
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
OgreOverlayPrerequisites.h
Ogre::Overlay::mScrollY
Real mScrollY
Definition: OgreOverlay.h:87
Ogre::Overlay::mName
String mName
Definition: OgreOverlay.h:76
Ogre::Overlay::mTransform
Matrix4 mTransform
Definition: OgreOverlay.h:91
Ogre::Camera
A viewpoint from which the scene will be rendered.
Definition: OgreCamera.h:86
Ogre::Overlay::mTransformOutOfDate
bool mTransformOutOfDate
Definition: OgreOverlay.h:92
Ogre::Overlay::isInitialised
bool isInitialised(void) const
Gets whether the overlay is initialised or not.
Definition: OgreOverlay.h:128
OgreIteratorWrappers.h
Ogre::Overlay::mVisible
bool mVisible
Definition: OgreOverlay.h:95
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::Overlay::mOrigin
String mOrigin
Definition: OgreOverlay.h:97
Ogre::ulong
unsigned long ulong
Definition: OgrePrerequisites.h:115
Ogre::Overlay::mZOrder
ulong mZOrder
Definition: OgreOverlay.h:94
Ogre::OverlayElement
Abstract definition of a 2D element to be displayed in an Overlay.
Definition: OgreOverlayElement.h:108
Ogre::Overlay::OverlayContainerList
list< OverlayContainer * >::type OverlayContainerList
Definition: OgreOverlay.h:74
Ogre::ushort
unsigned short ushort
Definition: OgrePrerequisites.h:113
Ogre::OverlayContainer
A 2D element which contains other OverlayElement instances.
Definition: OgreOverlayContainer.h:56
Ogre::Overlay
Represents a layer which is rendered on top of the &#39;normal&#39; scene contents.
Definition: OgreOverlay.h:70
OgreSceneNode.h
Ogre::Overlay::get2DElementsIterator
Overlay2DElementsIterator get2DElementsIterator()
Definition: OgreOverlay.h:258
Ogre::AllocatedObject
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Definition: OgreMemoryAllocatedObject.h:58
Ogre::Radian
Wrapper class which indicates a given angle value is in Radians.
Definition: OgreMath.h:47

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.