home *** CD-ROM | disk | FTP | other *** search
/ CICA 1994 September / CICA_Shareware_for_Windows_Walnut_Creek_September_1994.iso / win3 / programr / atre27.exe / ATREE_27 / OCRDEMO2 / OCR.H < prev    next >
C/C++ Source or Header  |  1992-08-01  |  6KB  |  142 lines

  1. /*****************************************************************************
  2.  ****                                                                     ****
  3.  **** ocr.h                                                               ****
  4.  ****                                                                     ****
  5.  **** atree release 2.7 for Windows                                       ****
  6.  **** Adaptive Logic Network (ALN) simulation program.                    ****
  7.  **** Copyright (C) M. Thomas, N. Sanche, W.W. Armstrong 1991, 1992       ****
  8.  ****                                                                                       ****
  9.  **** License:                                                            ****
  10.  **** A royalty-free license is granted for the use of this software for  ****
  11.  **** NON_COMMERCIAL PURPOSES ONLY. The software may be copied and/or     ****
  12.  **** modified provided this notice appears in its entirety and unchanged ****
  13.  **** in all derived source programs.  Persons modifying the code are     ****
  14.  **** requested to state the date, the changes made and who made them     ****
  15.  **** in the modification history.                                        ****
  16.  ****                                                                     ****
  17.  **** Patent License:                                                     ****
  18.  **** The use of a digital circuit which transmits a signal indicating    ****
  19.  **** heuristic responsibility is protected by U. S. Patent 3,934,231     ****
  20.  **** and others assigned to Dendronic Decisions Limited of Edmonton,     ****
  21.  **** W. W. Armstrong, President.  A royalty-free license is granted      ****
  22.  **** by the company to use this patent for NON_COMMERCIAL PURPOSES to    ****
  23.  **** adapt logic trees using this program and its modifications.         ****
  24.  ****                                                                     ****
  25.  **** Limited Warranty:                                                   ****
  26.  **** This software is provided "as is" without warranty of any kind,     ****
  27.  **** either expressed or implied, including, but not limited to, the     ****
  28.  **** implied warrantees of merchantability and fitness for a particular  ****
  29.  **** purpose.  The entire risk as to the quality and performance of the  ****
  30.  **** program is with the user.  Neither the authors, nor the             ****
  31.  **** University of Alberta, its officers, agents, servants or employees  ****
  32.  **** shall be liable or responsible in any way for any damage to         ****
  33.  **** property or direct personal or consequential injury of any nature   ****
  34.  **** whatsoever that may be suffered or sustained by any licensee, user  ****
  35.  **** or any other party as a consequence of the use or disposition of    ****
  36.  **** this software.                                                      ****
  37.  **** Modification history:                                               ****
  38.  ****                                                                     ****
  39.  **** 92.04.27 atree v2.5 for Windows, M. Thomas                          ****
  40.  **** 92.03.07 Release 2.6, Monroe Thomas, Neal Sanche                    ****
  41.  **** 92.01.08 Release 2.7, Monroe Thomas, Neal Sanche                    ****
  42.  ****                                                                     ****
  43.  *****************************************************************************/
  44.  
  45. // ocr.h
  46.  
  47. #include <owl.h>
  48. #include <dialog.h>
  49. #include <bstatic.h>
  50. #include <bbutton.h>
  51. #include <bwcc.h>
  52. #include <stdio.h>
  53. #include <iostream.h>
  54. #include <conio.h>
  55.  
  56. #include "atree.h"
  57. #include "bitmap.h"
  58. #include "ocr.rch"
  59.  
  60. _CLASSDEF(TOcr)
  61. class TOcr : public TDialog
  62. {
  63.     PTBitmapControl LightBulbA;
  64.     PTBitmapControl LightBulbL;
  65.     PTBitmapControl LightBulbN;
  66.     PTBitmapControl LetterA;
  67.     PTBitmapControl LetterL;
  68.     PTBitmapControl LetterN;
  69.     PTBitmapControl LetterBitmap;
  70.     PTBStatic Correct;
  71.     PTBStatic Incorrect;
  72.     PTBStatic Status;
  73.  
  74.     HBITMAP hLightOn;
  75.     HBITMAP hLightOff;
  76.     HBITMAP hLetterA;
  77.     HBITMAP hLetterL;
  78.     HBITMAP hLetterN;
  79.     HBITMAP hLetterClear;
  80.  
  81.     HMENU hSysMenu;
  82.  
  83.     BOOL stop;
  84.     BOOL shutdown;
  85.  
  86.     PTBButton Start;
  87.     PTBButton Stop;
  88.     PTBButton Train;
  89.     PTBButton Quit;
  90.     PTBButton Reverse;
  91.     PTBButton Forget;
  92.     PTBButton Reset;
  93.     PTBButton EditA;
  94.     PTBButton EditL;
  95.     PTBButton EditN;
  96.  
  97.     typedef struct tagTrainStruct
  98.     {
  99.         FILE* stream;
  100.         HBITMAP bitmaps[3];
  101.         int treesize;
  102.         int voters;
  103.         int numsamples;
  104.         WORD maxepochs;
  105.         float mincorrect;
  106.         int maxrotation;
  107.     } TrainStruct;
  108.  
  109.     BOOL vote(LPFAST_TREE* ftree, LPBIT_VEC vec, int voters);
  110.     void train(TrainStruct& ts);
  111.     void clear_bv(bit_vec);
  112.     void write_default();
  113.     void translate(HBITMAP hbm, int dx, int dy);
  114.  
  115. public:
  116.  
  117.     // constructor
  118.     TOcr();
  119.     ~TOcr();
  120.  
  121.     virtual LPSTR GetClassName();
  122.     virtual void GetWindowClass(WNDCLASS&);
  123.  
  124.     virtual void SetupWindow();
  125.  
  126.     virtual BOOL CanClose();
  127.  
  128.     virtual void OcrAbout() = [ID_FIRST + OCR_ABOUT];
  129.     virtual void OcrQuit() = [ID_FIRST + OCR_QUIT];
  130.     virtual void OcrStart() = [ID_FIRST + OCR_START];
  131.     virtual void OcrStop() = [ID_FIRST + OCR_STOP];
  132.     virtual void OcrTrain(RTMessage) = [ID_FIRST + OCR_TRAIN];
  133.     virtual void OcrReverse() = [ID_FIRST + OCR_REVERSE];
  134.     virtual void OcrForget() = [ID_FIRST + OCR_FORGET];
  135.     virtual void OcrReset() = [ID_FIRST + OCR_RESET];
  136.     virtual void OcrHelp() = [ID_FIRST + OCR_HELP];
  137.     virtual void OcrEditA() = [ID_FIRST + OCR_EDITA];
  138.     virtual void OcrEditL() = [ID_FIRST + OCR_EDITL];
  139.     virtual void OcrEditN() = [ID_FIRST + OCR_EDITN];
  140. };
  141.  
  142.