Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

OgreOverlay.h

Go to the documentation of this file.
00001 /*
00002 -----------------------------------------------------------------------------
00003 This source file is part of OGRE
00004     (Object-oriented Graphics Rendering Engine)
00005 For the latest info, see http://ogre.sourceforge.net/
00006 
00007 Copyright © 2000-2002 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 __Overlay_H__
00027 #define __Overlay_H__
00028 
00029 #include "OgrePrerequisites.h"
00030 #include "OgreString.h"
00031 #include "OgreSceneNode.h"
00032 #include "OgreIteratorWrappers.h"
00033 #include "OgreMatrix4.h"
00034 #include "OgreResource.h"
00035 
00036 namespace Ogre {
00037 
00038 
00063     class _OgreExport Overlay : public Resource
00064     {
00065 
00066     protected:
00067         ushort mZOrder;
00068         bool mVisible;
00070         SceneNode* mRootNode;
00071         // 2D elements
00072         // GuiContainers, linked list for easy sorting by zorder later
00073         // Not a map because sort can be saved since changes infrequent (unlike render queue)
00074         typedef std::list<GuiContainer*> GuiContainerList;
00075         GuiContainerList m2DElements;
00076 
00077         // Degrees of rotation around center
00078         Real mRotate;
00079         // Scroll values, offsets
00080         Real mScrollX, mScrollY;
00081         // Scale values
00082         Real mScaleX, mScaleY;
00083 
00084         Matrix4 mTransform;
00085         bool mTransformOutOfDate;
00087         void updateTransform(void);
00088 
00089     public:
00091         Overlay(const String& name);
00092         virtual ~Overlay();
00093 
00095         virtual void load(void);
00097         virtual void unload(void);
00098 
00099         GuiContainer* getChild(const String& name);
00100 
00102         const String& getName(void) const;
00107         void setZOrder(ushort zorder);
00109         ushort getZOrder(void) const;
00110 
00112         bool isVisible(void);
00113 
00115         void show(void);
00116 
00118         void hide(void);
00119 
00130         void add2D(GuiContainer* cont);
00131 
00132 
00137         void remove2D(GuiContainer* cont);
00138 
00167         void add3D(SceneNode* node);
00168 
00170         void remove3D(SceneNode* node);
00171 
00173         void clear();
00174 
00184         void setScroll(Real x, Real y);
00185 
00187         Real getScrollX(void);
00188 
00190         Real getScrollY(void);
00191 
00198         void scroll(Real xoff, Real yoff);
00199 
00201         void setRotate(Real degrees);
00202 
00204         Real getRotate(void);
00205 
00207         void rotate(Real degrees);
00208 
00209 
00217         void setScale(Real x, Real y);
00218 
00220         Real getScaleX(void);
00221 
00223         Real getScaleY(void);
00224 
00226         void _getWorldTransforms(Matrix4* xform);
00227 
00229         void _findVisibleObjects(Camera* cam, RenderQueue* queue);
00230 
00232         virtual GuiElement* findElementAt(Real x, Real y);
00233 
00234 
00235     };
00236 
00237 
00238 
00239 }
00240 
00241 
00242 #endif
00243 

Copyright © 2002 by The OGRE Team