SimInput.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-2005 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$
00027  * Date modified: $Date: 2005-01-15 18:00:37 -0600 (Sat, 15 Jan 2005) $
00028  * Version:       $Revision: 16622 $
00029  * -----------------------------------------------------------------
00030  *
00031  *************** <auto-copyright.pl END do not edit this line> ***************/
00032 
00033 #ifndef _GADGET_SIM_INPUT_H
00034 #define _GADGET_SIM_INPUT_H
00035 //#pragma once
00036 
00037 #include <gadget/gadgetConfig.h>
00038 #include <vector>
00039 #include <boost/concept_check.hpp>
00040 #include <jccl/Config/ConfigElementPtr.h>
00041 #include <gadget/Type/KeyboardMouseInterface.h>
00042 #include <vpr/IO/ObjectReader.h>
00043 #include <vpr/IO/ObjectWriter.h>
00044 #include <vpr/IO/SerializableObject.h>
00045 
00046 
00047 namespace gadget
00048 {
00049 
00055 class SimInput : public vpr::SerializableObject
00056 {
00057 public:
00058    class KeyModPair
00059    {
00060    public:
00061       KeyModPair() : mKey(gadget::KEY_NONE), mModifier(gadget::KEY_NONE)
00062       {;}
00063 
00064       KeyModPair(gadget::Keys key, gadget::Keys modifier)
00065          : mKey(key), mModifier(modifier)
00066       {;}
00067 
00068       KeyModPair(const KeyModPair& in)
00069       {
00070          copy(in);
00071       }
00072 
00073       const KeyModPair& operator=(const KeyModPair& in)
00074       {
00075          copy(in);
00076          return *this;
00077       }
00078 
00079       void copy(const KeyModPair& in)
00080       {
00081          mKey      = in.mKey;
00082          mModifier = in.mModifier;
00083       }
00084 
00085    public:
00086       gadget::Keys mKey;
00087       gadget::Keys mModifier;
00088    };
00089 
00090 public:
00091    SimInput()
00092    {
00093       //vprDEBUG(vprDBG_ALL, vprDBG_VERB_LVL)<<"*** SimInput::SimInput()\n"<< vprDEBUG_FLUSH;
00094    }
00095    virtual ~SimInput() {}
00096 
00101    virtual bool config(jccl::ConfigElementPtr element);
00102 
00103    virtual std::string getInputTypeName()
00104    {
00105        return std::string("SimInput");
00106    }
00107 
00108    virtual vpr::ReturnStatus writeObject(vpr::ObjectWriter* writer)
00109    {
00110       boost::ignore_unused_variable_warning(writer);
00111       return vpr::ReturnStatus::Succeed;
00112    }
00113 
00114    virtual vpr::ReturnStatus readObject(vpr::ObjectReader* reader)
00115    {
00116       boost::ignore_unused_variable_warning(reader);
00117       return vpr::ReturnStatus::Succeed;
00118    }
00119 
00120 protected:
00121 
00127    virtual int checkKeyPair(KeyModPair& pair);
00128 
00139    std::vector<KeyModPair> readKeyList(std::vector<jccl::ConfigElementPtr>& keyList);
00140 
00141 protected:
00143    KeyboardMouseInterface mKeyboardMouse;
00144 };
00145 
00146 } // End of gadget namespace
00147 
00148 
00149 #endif

Generated on Thu Jan 4 10:41:56 2007 for Gadgeteer by  doxygen 1.5.1