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

OgreCursor.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 
00027 /***************************************************************************
00028 OgreCursor.h  -  
00029     The Cursor is an non-visual object that contains a the XYZ values that 
00030     are modified by a InputReader.
00031     An InputReader creates and contains a Cursor object that it uses when it 
00032     is set to buffered input (using the EventQueue).
00033 
00034     To get a graphical representation of the cursor, a CursorGuiElement is
00035     used, which is a MouseMotionListener to the Cursor.
00036 
00037 -------------------
00038 begin                : Nov 19 2002
00039 copyright            : (C) 2002 by Kenny Sabir
00040 email                : kenny@sparksuit.com
00041 ***************************************************************************/
00042 
00043 #ifndef __Cursor_H__
00044 #define __Cursor_H__
00045 
00046 #include "OgrePrerequisites.h"
00047 #include "OgreEventListeners.h"
00048 #include "OgreMouseMotionTarget.h"
00049 #include "OgreMouseTarget.h"
00050 
00051 namespace Ogre {
00061     class _OgreExport Cursor : public MouseMotionTarget, public MouseTarget
00062     {
00063     protected:
00065         Real mMouseX, mMouseY, mMouseZ;
00066 
00068         Real mXLowLimit, mXHighLimit, mYLowLimit, mYHighLimit, mZLowLimit, mZHighLimit;
00069 
00072         Real mScale;
00073 
00075         inline Real limit(Real val, Real low, Real high)
00076         {   return (val < low) ? low: ((val > high) ? high : val); }
00077     public :
00078         Cursor();
00079         ~Cursor();
00080 
00082         void addToX(Real val);
00083 
00085         void addToY(Real val);
00086 
00088         void addToZ(Real val);
00089 
00091         void processEvent(InputEvent* e);
00092 
00093 
00095         Real getX() const;
00096 
00098         Real getY() const;
00099 
00101         Real getZ() const;
00102 
00103 
00104     // PositionTarget methods
00106         Real getLeft(void) const ;
00107 
00109         Real getTop(void) const ;
00110 
00112         PositionTarget* getPositionTargetParent();
00113 
00114     };
00115 
00116 }
00117 
00118 
00119 #endif  // __Cursor_H__

Copyright © 2002 by The OGRE Team