OgreOverlayContainer.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 __OverlayContainer_H__
30 #define __OverlayContainer_H__
31 
33 #include "OgreOverlayElement.h"
34 #include "OgreIteratorWrappers.h"
35 
36 
37 namespace Ogre {
38 
39 
57  {
58  public:
63  protected:
68 
70 
71  public:
73  OverlayContainer(const String& name);
74  virtual ~OverlayContainer();
75 
77  virtual void addChild(OverlayElement* elem);
79  virtual void addChildImpl(OverlayElement* elem);
81  virtual void addChildImpl(OverlayContainer* cont);
83  virtual void removeChild(const String& name);
85  virtual OverlayElement* getChild(const String& name);
86 
88  void initialise(void);
89 
91  void _removeChild(OverlayElement* elem) { _removeChild(elem->getName()); }
92  void _removeChild(const String& name);
93 
96 
102 
104  virtual void _positionsOutOfDate(void);
105 
107  virtual void _update(void);
108 
110  virtual ushort _notifyZOrder(ushort newZOrder);
111 
113  virtual void _notifyViewport();
114 
116  virtual void _notifyWorldTransforms(const Matrix4& xform);
117 
119  virtual void _notifyParent(OverlayContainer* parent, Overlay* overlay);
120 
122  virtual void _updateRenderQueue(RenderQueue* queue);
123 
125  inline bool isContainer() const
126  { return true; }
127 
129  virtual inline bool isChildrenProcessEvents() const
130  { return true; }
131 
133  virtual inline void setChildrenProcessEvents(bool val)
134  { mChildrenProcessEvents = val; }
135 
137  virtual OverlayElement* findElementAt(Real x, Real y); // relative to parent
138 
139  void copyFromTemplate(OverlayElement* templateOverlay);
140  virtual OverlayElement* clone(const String& instanceName);
141 
142  };
143 
144 
148 }
149 
150 
151 #endif
152 
Ogre::OverlayElement
Abstract definition of a 2D element to be displayed in an Overlay.
Definition: OgreOverlayElement.h:109
Ogre::OverlayContainer::_updateRenderQueue
virtual void _updateRenderQueue(RenderQueue *queue)
Overridden from OverlayElement.
Ogre
Definition: OgreAndroidLogListener.h:35
Ogre::map
Definition: OgrePrerequisites.h:534
Ogre::ushort
unsigned short ushort
Definition: OgrePrerequisites.h:113
OgreOverlayPrerequisites.h
Ogre::OverlayContainer::_update
virtual void _update(void)
Overridden from OverlayElement.
Ogre::OverlayContainer::clone
virtual OverlayElement * clone(const String &instanceName)
Ogre::OverlayContainer::_removeChild
void _removeChild(OverlayElement *elem)
Definition: OgreOverlayContainer.h:91
Ogre::OverlayContainer::addChild
virtual void addChild(OverlayElement *elem)
Adds another OverlayElement to this container.
Ogre::OverlayContainer::_notifyViewport
virtual void _notifyViewport()
Overridden from OverlayElement.
Ogre::OverlayContainer::_notifyParent
virtual void _notifyParent(OverlayContainer *parent, Overlay *overlay)
Overridden from OverlayElement.
Ogre::OverlayContainer::mChildrenProcessEvents
bool mChildrenProcessEvents
Definition: OgreOverlayContainer.h:69
Ogre::OverlayContainer::~OverlayContainer
virtual ~OverlayContainer()
Ogre::OverlayContainer::isChildrenProcessEvents
virtual bool isChildrenProcessEvents() const
Should this container pass events to their children.
Definition: OgreOverlayContainer.h:129
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::OverlayContainer::_positionsOutOfDate
virtual void _positionsOutOfDate(void)
Tell the object and its children to recalculate.
Ogre::OverlayContainer::OverlayContainer
OverlayContainer(const String &name)
Constructor: do not call direct, use OverlayManager::createOverlayElement.
Ogre::OverlayContainer::ChildMap
map< String, OverlayElement * >::type ChildMap
Definition: OgreOverlayContainer.h:59
Ogre::OverlayContainer::initialise
void initialise(void)
Initialise gui element.
Ogre::Matrix4
Class encapsulating a standard 4x4 homogeneous matrix.
Definition: OgreMatrix4.h:79
Ogre::OverlayContainer::getChildIterator
virtual ChildIterator getChildIterator(void)
Gets an object for iterating over all the children of this object.
Ogre::OverlayContainer::setChildrenProcessEvents
virtual void setChildrenProcessEvents(bool val)
Should this container pass events to their children.
Definition: OgreOverlayContainer.h:133
_OgreOverlayExport
#define _OgreOverlayExport
Definition: OgreOverlayPrerequisites.h:58
Ogre::OverlayContainer::_notifyWorldTransforms
virtual void _notifyWorldTransforms(const Matrix4 &xform)
Overridden from OverlayElement.
Ogre::OverlayContainer::addChildImpl
virtual void addChildImpl(OverlayContainer *cont)
Add a nested container to this container.
Ogre::OverlayContainer::getChild
virtual OverlayElement * getChild(const String &name)
Gets the named child of this container.
Ogre::OverlayContainer::isContainer
bool isContainer() const
Overridden from OverlayElement.
Definition: OgreOverlayContainer.h:125
Ogre::OverlayContainer::_addChild
void _addChild(OverlayElement *elem)
Ogre::OverlayContainer::_notifyZOrder
virtual ushort _notifyZOrder(ushort newZOrder)
Overridden from OverlayElement.
Ogre::OverlayContainer::getChildContainerIterator
virtual ChildContainerIterator getChildContainerIterator(void)
Gets an iterator for just the container children of this object.
Ogre::MapIterator
Concrete IteratorWrapper for nonconst access to the underlying key-value container.
Definition: OgreIteratorWrapper.h:319
OgreIteratorWrappers.h
Ogre::OverlayContainer::ChildContainerIterator
MapIterator< ChildContainerMap > ChildContainerIterator
Definition: OgreOverlayContainer.h:62
Ogre::OverlayElement::getName
const String & getName(void) const
Gets the name of this overlay.
Ogre::OverlayContainer::mChildren
ChildMap mChildren
Map of all children.
Definition: OgreOverlayContainer.h:65
Ogre::OverlayContainer::copyFromTemplate
void copyFromTemplate(OverlayElement *templateOverlay)
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
Ogre::OverlayContainer::findElementAt
virtual OverlayElement * findElementAt(Real x, Real y)
This returns a OverlayElement at position x,y.
Ogre::OverlayContainer::removeChild
virtual void removeChild(const String &name)
Removes a named element from this container.
OgreOverlayElement.h
Ogre::OverlayContainer::ChildContainerMap
map< String, OverlayContainer * >::type ChildContainerMap
Definition: OgreOverlayContainer.h:61
Ogre::OverlayContainer::_removeChild
void _removeChild(const String &name)
Ogre::OverlayContainer::ChildIterator
MapIterator< ChildMap > ChildIterator
Definition: OgreOverlayContainer.h:60
Ogre::OverlayContainer::addChildImpl
virtual void addChildImpl(OverlayElement *elem)
Adds another OverlayElement to this container.
Ogre::Overlay
Represents a layer which is rendered on top of the 'normal' scene contents.
Definition: OgreOverlay.h:71
Ogre::RenderQueue
Class to manage the scene object rendering queue.
Definition: OgreRenderQueue.h:93
Ogre::OverlayContainer
A 2D element which contains other OverlayElement instances.
Definition: OgreOverlayContainer.h:57
Ogre::OverlayContainer::mChildContainers
ChildContainerMap mChildContainers
Map of container children (subset of mChildren)
Definition: OgreOverlayContainer.h:67

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