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

MobileButtons.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: MobileButtons.C,v $
00013  *      $Author: johns $        $Locker:  $             $State: Exp $
00014  *      $Revision: 1.3 $        $Date: 2019/01/17 21:21:00 $
00015  *
00016  ***************************************************************************/
00017 #include "VMDApp.h"
00018 #include "ResizeArray.h"
00019 #include "P_Buttons.h"
00020 #include "MobileButtons.h"
00021 #include "Inform.h"
00022 
00023 MobileButtons::MobileButtons(VMDApp *vmdapp) {
00024   app = vmdapp;
00025   numButtons = 31;
00026 }
00027 
00028 int MobileButtons::do_start(const SensorConfig *) {
00029   msgInfo << "Opening VMD console Mobile device (buttons)." << sendmsg;
00030   return 1;
00031 }
00032 
00033 void MobileButtons::update() {
00034   float tx, ty, tz, rx, ry, rz;
00035   tx=ty=tz=rx=ry=rz=0.0f;
00036   int buttons;
00037   buttons=0;
00038 
00039   // query VMDApp for events
00040   if (app != NULL) {
00041     app->mobile_get_tracker_status(tx, ty, tz, rx, ry, rz, buttons);
00042   }
00043 
00044   stat[0] = 0;
00045   for(int i = 0; i < numButtons; i++) {
00046     stat[i] = (buttons >> i) & 1;
00047     stat[0] |= (buttons >> i) & 1;
00048   }
00049 }
00050 

Generated on Fri Apr 19 02:44:40 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002