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

App.h

Go to the documentation of this file.
00001 /*************** <auto-copyright.pl BEGIN do not edit this line> **************
00002  *
00003  * VR Juggler is (C) Copyright 1998-2003 by Iowa State University
00004  *
00005  * Original Authors:
00006  *   Allen Bierbaum, Christopher Just,
00007  *   Patrick Hartling, Kevin Meinert,
00008  *   Carolina Cruz-Neira, Albert Baker
00009  *
00010  * This library is free software; you can redistribute it and/or
00011  * modify it under the terms of the GNU Library General Public
00012  * License as published by the Free Software Foundation; either
00013  * version 2 of the License, or (at your option) any later version.
00014  *
00015  * This library is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  * Library General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU Library General Public
00021  * License along with this library; if not, write to the
00022  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00023  * Boston, MA 02111-1307, USA.
00024  *
00025  * -----------------------------------------------------------------
00026  * File:          $RCSfile: App.h,v $
00027  * Date modified: $Date: 2003/12/08 14:28:20 $
00028  * Version:       $Revision: 1.47 $
00029  * -----------------------------------------------------------------
00030  *
00031  *************** <auto-copyright.pl END do not edit this line> ***************/
00032 
00033 #ifndef _VRJ_APP_H_
00034 #define _VRJ_APP_H_
00035 
00036 #include <vrj/vrjConfig.h>
00037 
00038 #include <boost/concept_check.hpp>
00039 
00040 #include <vpr/Util/Assert.h>
00041 #include <vrj/Util/Debug.h>
00042 #include <jccl/RTRC/ConfigElementHandler.h>
00043 #include <vrj/Sound/SoundManagerFactory.h>
00044 
00045 #include <gadget/Type/PositionProxy.h>
00046 #include <gadget/Type/Position/PositionUnitConversion.h>
00047 
00048 namespace vrj
00049 {
00050 
00051 class DrawManager;
00052 class Kernel;
00053 
00082 class VJ_CLASS_API App : public jccl::ConfigElementHandler
00083 {
00084 public:
00090    App(Kernel* kern);
00091 
00093    App();
00094 
00095    virtual ~App()
00096    {
00097       /* Do nothing. */ ;
00098    }
00099 
00100 public:
00101 
00107    virtual void init()
00108    {;}
00109 
00115    virtual void apiInit()
00116    {;}
00117 
00119    virtual void exit()
00120    {;}
00121 
00126    virtual void preFrame()
00127    {;}
00128 
00136    virtual void latePreFrame()
00137    {;}
00138 
00140    virtual void intraFrame()
00141    {;}
00142 
00146    virtual void postFrame()
00147    {;}
00148 
00154    virtual void reset()
00155    {;}
00156 
00167    bool haveFocus()
00168    {
00169       return mHaveFocus;
00170    }
00171 
00173    virtual void focusChanged()
00174    {;}
00175 
00182    void setFocus(bool newState)
00183    {
00184       if(newState != mHaveFocus)
00185       {
00186          mHaveFocus = newState;
00187          this->focusChanged();
00188       }
00189    }
00190 
00200    virtual float getDrawScaleFactor()
00201    {
00202       return gadget::PositionUnitConversion::ConvertToFeet;
00203    }
00204 
00205 
00206 public:  // --- Default config handlers: (inherited from jccl::ConfigElementHandler) --- //
00208    virtual bool configCanHandle(jccl::ConfigElementPtr element)
00209    {
00210       boost::ignore_unused_variable_warning(element);
00211       return false;
00212    }
00213 
00221    virtual bool depSatisfied()
00222    {
00223       return true;
00224    }
00225 
00226 protected:
00228    virtual bool configAdd(jccl::ConfigElementPtr element)
00229    {
00230       boost::ignore_unused_variable_warning(element);
00231       vprASSERT(false);
00232       return false;
00233    }
00234 
00236    virtual bool configRemove(jccl::ConfigElementPtr element)
00237    {
00238       boost::ignore_unused_variable_warning(element);
00239       vprASSERT(false);
00240       return false;
00241    }
00242 
00243 public:
00244    Kernel* mKernel;     // The library kernel (here for convienence)
00245    bool    mHaveFocus;
00246 
00247 public:  // --- Factory functions --- //
00252    virtual DrawManager* getDrawManager() = 0;
00253 
00258    virtual SoundManager* getSoundManager()
00259    {
00260       return &SoundManagerFactory::get();
00261    }
00262 };
00263 
00264 }
00265 
00266 #endif

Generated on Sun May 2 15:10:16 2004 for VR Juggler by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002