00001 /* 00002 ----------------------------------------------------------------------------- 00003 This source file is part of OGRE 00004 (Object-oriented Graphics Rendering Engine) 00005 For the latest info, see http://www.ogre3d.org/ 00006 00007 Copyright (c) 2000-2005 The OGRE Team 00008 Also see acknowledgements in Readme.html 00009 00010 This program is free software; you can redistribute it and/or modify it under 00011 the terms of the GNU Lesser General Public License as published by the Free Software 00012 Foundation; either version 2 of the License, or (at your option) any later 00013 version. 00014 00015 This program is distributed in the hope that it will be useful, but WITHOUT 00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser General Public License along with 00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple 00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to 00022 http://www.gnu.org/copyleft/lesser.txt. 00023 ----------------------------------------------------------------------------- 00024 */ 00025 00026 #ifndef __OverlayContainer_H__ 00027 #define __OverlayContainer_H__ 00028 00029 #include "OgrePrerequisites.h" 00030 #include "OgreOverlayElement.h" 00031 #include "OgreIteratorWrappers.h" 00032 00033 00034 namespace Ogre { 00035 00036 00047 class _OgreExport OverlayContainer : public OverlayElement 00048 { 00049 public: 00050 typedef std::map<String, OverlayElement*> ChildMap; 00051 typedef MapIterator<ChildMap> ChildIterator; 00052 typedef std::map<String, OverlayContainer*> ChildContainerMap; 00053 typedef MapIterator<ChildContainerMap> ChildContainerIterator; 00054 protected: 00055 // Map of all children 00056 ChildMap mChildren; 00057 // Map of container children (subset of mChildren) 00058 ChildContainerMap mChildContainers; 00059 00060 bool mChildrenProcessEvents; 00061 00062 public: 00064 OverlayContainer(const String& name); 00065 virtual ~OverlayContainer(); 00066 00068 virtual void addChild(OverlayElement* elem); 00070 virtual void addChildImpl(OverlayElement* elem); 00072 virtual void addChildImpl(OverlayContainer* cont); 00074 virtual void removeChild(const String& name); 00076 virtual OverlayElement* getChild(const String& name); 00077 00079 void initialise(void); 00080 00081 void _addChild(OverlayElement* elem); 00082 void _removeChild(OverlayElement* elem) { _removeChild(elem->getName()); } 00083 void _removeChild(const String& name); 00084 00086 virtual ChildIterator getChildIterator(void); 00087 00092 virtual ChildContainerIterator getChildContainerIterator(void); 00093 00095 virtual void _positionsOutOfDate(void); 00096 00098 virtual void _update(void); 00099 00101 virtual void _notifyZOrder(ushort newZOrder); 00102 00104 virtual void _notifyViewport(); 00105 00107 virtual void _notifyWorldTransforms(const Matrix4& xform); 00108 00110 virtual void _notifyParent(OverlayContainer* parent, Overlay* overlay); 00111 00113 virtual void _updateRenderQueue(RenderQueue* queue); 00114 00116 inline bool isContainer() const 00117 { return true; } 00118 00120 virtual inline bool isChildrenProcessEvents() const 00121 { return true; } 00122 00124 virtual inline void setChildrenProcessEvents(bool val) 00125 { mChildrenProcessEvents = val; } 00126 00128 virtual OverlayElement* findElementAt(Real x, Real y); // relative to parent 00129 00130 void copyFromTemplate(OverlayElement* templateOverlay); 00131 virtual OverlayElement* clone(const String& instanceName); 00132 00133 }; 00134 00135 00136 00137 } 00138 00139 00140 #endif 00141
Copyright © 2000-2005 by The OGRE Team
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Mar 12 14:37:45 2006