recognisertestpad.h

Go to the documentation of this file.
00001 /*  -*- c++ -*-  (for Emacs)
00002  *
00003  *  recognisertestpad.h
00004  *  Digest
00005  * 
00006  *  Created by Aidan Lane on Tue Jul 12 2005.
00007  *  Copyright (c) 2005-2006 Optimisation and Constraint Solving Group,
00008  *  Monash University. All rights reserved.
00009  *
00010  *  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version.
00014  *
00015  *  This program 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
00018  *  GNU General Public License for more details.
00019  *
00020  *  You should have received a copy of the GNU General Public License
00021  *  along with this program; if not, write to the Free Software
00022  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00023  */
00024 
00025 #ifndef RECOGNISERTESTPAD_H
00026 #define RECOGNISERTESTPAD_H
00027 
00028 
00029 #include "DigestGuiCore/guicomponentwidgets.h"
00030 
00031 #include <QHash>
00032 #include <QMultiMap>
00033 
00034 #include <jni.h>
00035 
00036 #include "GestureRecognition/abstractrecogniser.h"
00037 
00038 #include "ui_recognisertestpadform.h"
00039 
00040 class DigestDbController;
00041 class SettingsController;
00042 
00043 
00044 class RecogniserTestPad : public GuiDbComponentDialog {
00045 
00046   Q_OBJECT
00047 
00048 public:
00049   RecogniserTestPad( DigestDbController* digestDbController,
00050                      SettingsController* settingsController,
00051                      JavaVM* jvm,
00052                      QWidget* parent = 0, Qt::WindowFlags flags = 0 );
00053 
00054 
00055 private slots:
00056   void on_enableAllButton_clicked();
00057   void on_enableNoneButton_clicked();
00058   void on_recogniseButton_clicked();
00059   void on_clearButton_clicked();
00060 
00061   void recognise( const StrokeList& strokes );
00062   void updateInfoText();
00063 
00064 
00065 protected:
00066   void showEvent( QShowEvent* event );
00067 
00068   void resetEvent( VEvent* );
00069   void trainedRecogsEvent( VTrainedRecogsEvent* );
00070 
00071 
00072 private:
00073   void refreshTrainedRecogList();
00074   void initRecognisers();
00075   void setAllRecognisersCheckState( Qt::CheckState state );
00076 
00077   QString trainedRecogRecordAsHtml( const DTrainedRecogRecord& record ) const;
00078   
00079   QString recogResultsAsHtml
00080   ( const QMultiMap<QString,ClassProbabilities>& results ) const;
00081 
00082   Ui::RecogniserTestPadForm   m_ui;
00083   JavaVM*                     m_jvm;
00084 
00085   // Recognisers: instance -> label
00086   // Note: It couldn't be label -> instance, as LABELS ARE *NOT* ALWAYS UNIQUE
00087   QHash<AbstractRecogniser*, QString>  m_recognisers;
00088 };
00089 
00090 
00091 #endif  // ! RECOGNISERTESTPAD_H

Generated on Mon Jul 30 09:46:50 2007 for Digest by  doxygen 1.5.2