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-2013 Torus Knot Software Ltd 00008 00009 Permission is hereby granted, free of charge, to any person obtaining a copy 00010 of this software and associated documentation files (the "Software"), to deal 00011 in the Software without restriction, including without limitation the rights 00012 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 00013 copies of the Software, and to permit persons to whom the Software is 00014 furnished to do so, subject to the following conditions: 00015 00016 The above copyright notice and this permission notice shall be included in 00017 all copies or substantial portions of the Software. 00018 00019 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00020 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00021 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 00022 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00023 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 00024 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 00025 THE SOFTWARE. 00026 ----------------------------------------------------------------------------- 00027 */ 00028 00029 #ifndef __Overlay_H__ 00030 #define __Overlay_H__ 00031 00032 #include "OgreOverlayPrerequisites.h" 00033 #include "OgreSceneNode.h" 00034 #include "OgreIteratorWrappers.h" 00035 #include "OgreMatrix4.h" 00036 00037 namespace Ogre { 00038 00039 00070 class _OgreOverlayExport Overlay : public OverlayAlloc 00071 { 00072 00073 public: 00074 typedef list<OverlayContainer*>::type OverlayContainerList; 00075 protected: 00076 String mName; 00078 SceneNode* mRootNode; 00082 OverlayContainerList m2DElements; 00083 00085 Radian mRotate; 00087 Real mScrollX, mScrollY; 00089 Real mScaleX, mScaleY; 00090 00091 mutable Matrix4 mTransform; 00092 mutable bool mTransformOutOfDate; 00093 bool mTransformUpdated; 00094 ulong mZOrder; 00095 bool mVisible; 00096 bool mInitialised; 00097 String mOrigin; 00099 void updateTransform(void) const; 00101 void initialise(void); 00103 void assignZOrders(void); 00104 00105 public: 00107 Overlay(const String& name); 00108 virtual ~Overlay(); 00109 00110 00111 OverlayContainer* getChild(const String& name); 00112 00114 const String& getName(void) const; 00115 00120 void setZOrder(ushort zorder); 00122 ushort getZOrder(void) const; 00123 00125 bool isVisible(void) const; 00126 00128 bool isInitialised(void) const { return mInitialised; } 00129 00131 void show(void); 00132 00134 void hide(void); 00135 00146 void add2D(OverlayContainer* cont); 00147 00148 00153 void remove2D(OverlayContainer* cont); 00154 00187 void add3D(SceneNode* node); 00188 00190 void remove3D(SceneNode* node); 00191 00193 void clear(); 00194 00204 void setScroll(Real x, Real y); 00205 00207 Real getScrollX(void) const; 00208 00210 Real getScrollY(void) const; 00211 00218 void scroll(Real xoff, Real yoff); 00219 00221 void setRotate(const Radian& angle); 00222 00224 const Radian &getRotate(void) const { return mRotate; } 00225 00227 void rotate(const Radian& angle); 00228 00236 void setScale(Real x, Real y); 00237 00239 Real getScaleX(void) const; 00240 00242 Real getScaleY(void) const; 00243 00245 void _getWorldTransforms(Matrix4* xform) const; 00246 00248 void _findVisibleObjects(Camera* cam, RenderQueue* queue); 00249 00251 virtual OverlayElement* findElementAt(Real x, Real y); 00252 00257 typedef VectorIterator<OverlayContainerList> Overlay2DElementsIterator ; 00258 Overlay2DElementsIterator get2DElementsIterator () 00259 { 00260 return Overlay2DElementsIterator (m2DElements.begin(), m2DElements.end()); 00261 } 00268 const String& getOrigin(void) const { return mOrigin; } 00270 void _notifyOrigin(const String& origin) { mOrigin = origin; } 00271 00272 00273 }; 00277 } 00278 00279 00280 #endif 00281
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Mon Jul 27 2020 13:40:44