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

PhoneButtons.C

Go to the documentation of this file.
00001 /***************************************************************************
00002  *cr                                                                       
00003  *cr            (C) Copyright 1995-2019 The Board of Trustees of the           
00004  *cr                        University of Illinois                       
00005  *cr                         All Rights Reserved                        
00006  *cr                                                                   
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  * RCS INFORMATION:
00011  *
00012  *      $RCSfile: PhoneButtons.C,v $
00013  *      $Author: johns $        $Locker:  $             $State: Exp $
00014  *      $Revision: 1.5 $        $Date: 2019/01/17 21:21:01 $
00015  *
00016  ***************************************************************************/
00017 
00018 #if defined(VMDPHONETRACKER)
00019 
00020 #include "VMDApp.h"
00021 #include "ResizeArray.h"
00022 #include "P_Buttons.h"
00023 #include "PhoneButtons.h"
00024 #include "Inform.h"
00025 
00026 PhoneButtons::PhoneButtons(VMDApp *vmdapp) {
00027   app = vmdapp;
00028   numButtons = 31;
00029 }
00030 
00031 int PhoneButtons::do_start(const SensorConfig *) {
00032   msgInfo << "Opening VMD console Phone device (buttons)." << sendmsg;
00033   return 1;
00034 }
00035 
00036 void PhoneButtons::update() {
00037   float tx, ty, tz, rx, ry, rz;
00038   tx=ty=tz=rx=ry=rz=0.0f;
00039   int buttons;
00040   buttons=0;
00041 
00042   // query VMDApp for events
00043   if (app != NULL) {
00044     app->mobile_get_tracker_status(tx, ty, tz, rx, ry, rz, buttons);
00045   }
00046 
00047   stat[0] = 0;
00048   for(int i = 0; i < numButtons; i++) {
00049     stat[i] = (buttons >> i) & 1;
00050     stat[0] |= (buttons >> i) & 1;
00051   }
00052 }
00053 
00054 #endif
00055 

Generated on Thu Mar 28 02:43:59 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002