AaronCameron.net
Because you all make me very, very tired.
Not a Member? - Login or Create an Account
Wednesday the 23rd of May 2012 @ 09:47am
Front Page Journal Projects Your Profile About
[]

LibN2L-4 Library Code Reference

Classes
Compounds
Files
Members
Method Index
Full Reference

cGuiModelView.h

Go to the documentation of this file.
00001 /************************************************************************
00002 Nova-2 Library (libN2L, or simply n2l) Game development C++ Library
00003 Copyright (C) 2002  Aaron Cameron
00004 
00005 This library is free software; you can redistribute it and/or
00006 modify it under the terms of the GNU Lesser General Public
00007 License as published by the Free Software Foundation; either
00008 version 2.1 of the License, or (at your option) any later version.
00009 
00010 This library is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 Lesser General Public License for more details.
00014 
00015 You should have received a copy of the GNU Lesser General Public
00016 License along with this library; if not, write to the Free Software
00017 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00018 
00019 A copy of the GNU Lesser General Public License has been provided with
00020 this library in the file 'COPYING'.
00021 
00022 Contact information for the author of this library has been provided
00023 with this library in the file 'AUTHOR'.
00024 ************************************************************************/
00025 #ifndef _n2l4_cGuiModelView_H
00026 #define _n2l4_cGuiModelView_H
00027 
00028 #include "n2l/n2l.h"
00029 
00030 #include "gui/types.h"
00031 #include "gui/cGuiElement.h"
00032 
00033 /******************************************************************************/
00034 namespace n2l
00035 {
00036     class cVfsNodeInterface;
00037     class cDynVar;
00038     class cRVisualTriMesh;
00039     class cGLTexture;
00040     class cRProjectionInterface;
00041     class cRFreeCamera;
00042     class cGuiFill;
00043 
00044     /**************************************************************************/
00048     class cGuiModelView : public cGuiElement
00049     {
00050     public:
00051         typedef enum {
00052             CameraMode_Auto,
00053             CameraMode_Manual,
00054 
00055             CameraMode_NumCameraModes
00056         } tCameraMode;
00057     
00058         cGuiModelView();
00059         cGuiModelView( const cVfsNodeInterface & iNode );
00060         cGuiModelView( const cDynVar & iDefinition );
00061         virtual ~cGuiModelView();
00062 
00063         virtual void load( const cVfsNodeInterface & iNode );
00064         virtual void load( const cDynVar & iDefinition );
00065 
00066         virtual void update( const tUint iTimePassed );
00067 
00068         virtual void draw() const;
00069 
00070         virtual const cAutoPtr<const cRVisualTriMesh> &model() const {
00071             return mMesh;
00072         }
00073 
00074         virtual void mesh( const cAutoPtr<const cRVisualTriMesh> &iMesh );
00075         inline virtual void model(
00076             const cAutoPtr<const cRVisualTriMesh> &iMesh ) {
00077             mesh(iMesh);
00078         }
00079         virtual void texture( const cAutoPtr<const cGLTexture> &iTexture );
00080 
00081         virtual void meshTrans( const tMatrix44f &iTrans );
00082         virtual const tMatrix44f &meshTrans() const { return mMeshTrans; }
00083 
00084         virtual const cAutoPtr<cGuiElement> clone() const;
00085 
00086         static const cAutoPtr<cGuiElement> loadNew( const cDynVar &iDef );
00087 
00088         virtual void prop( const tString &iName, const cDynVar &iVal,
00089             const tString &iInnerKey = "" );
00090         virtual const cDynVar prop( const tString &iName,
00091             const tString &iInnerKey = "" ) const;
00092 
00093     protected:
00094         virtual void cloneInto(
00095             const cAutoPtr<cGuiModelView> &i_ioElement ) const;
00096 
00097     private:
00098         cAutoPtr<const cRVisualTriMesh> mMesh;
00099         tMatrix44f mMeshTrans;
00100 
00101         tVector3f mMeshDim;
00102         cAutoPtr<const cGLTexture> mTexture;
00103 
00104         cAutoPtr<cRProjectionInterface> mPerProj;
00105         cAutoPtr<cRFreeCamera> mCamera;
00106 
00107         tUint mCamVersion;
00108         tBool mNeedsUpdate;
00109 
00110         cAutoPtr<cGuiFill> mFill;
00111 
00112         tCameraMode mCamMode;
00113 
00114         cAutoPtr<cGLTexture> mRender;
00115 
00116         cGuiModelView( const cGuiModelView & );
00117         void init();
00118 
00119      };
00120 
00121 } // namespace n2l
00122 
00123 #endif
©2012 Aaron Cameron