• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**********************************************************************
2  * File:        drawfx.cpp  (Formerly drawfx.c)
3  * Description: Draw things to do with feature extraction.
4  * Author:		Ray Smith
5  * Created:		Mon Jan 27 11:02:16 GMT 1992
6  *
7  * (C) Copyright 1992, Hewlett-Packard Ltd.
8  ** Licensed under the Apache License, Version 2.0 (the "License");
9  ** you may not use this file except in compliance with the License.
10  ** You may obtain a copy of the License at
11  ** http://www.apache.org/licenses/LICENSE-2.0
12  ** Unless required by applicable law or agreed to in writing, software
13  ** distributed under the License is distributed on an "AS IS" BASIS,
14  ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  ** See the License for the specific language governing permissions and
16  ** limitations under the License.
17  *
18  **********************************************************************/
19 
20 #include "mfcpch.h"
21 #include          "debugwin.h"
22 #include          "werd.h"
23 #include          "drawfx.h"
24 
25 #ifndef GRAPHICS_DISABLED
26 #define FXDEMOWIN     "FXDemo"
27 #define FXDEMOXPOS      250
28 #define FXDEMOYPOS      0
29 #define FXDEMOXSIZE     600
30 #define FXDEMOYSIZE     256
31 #define BLN_MAX       512        //max coord for bln
32 #define WERDWIDTH       (BLN_MAX*20)
33 #define DECENT_WERD_WIDTH (5*bln_x_height)
34                                  //title of window
35 #define DEBUG_WIN_NAME    "FXDebug"
36 #define DEBUG_XPOS      0
37 #define DEBUG_YPOS      120
38 #define DEBUG_XSIZE     80
39 #define DEBUG_YSIZE     32
40 #define YMAX        3508
41 #define XMAX        2550
42 #define MAXEDGELENGTH   1024     //max steps inoutline
43 
44 #define EXTERN
45 
46 EXTERN STRING_VAR (fx_debugfile, DEBUG_WIN_NAME, "Name of debugfile");
47 
48 EXTERN ScrollView* fx_win = NULL;
49 EXTERN FILE *fx_debug = NULL;
50 
51 /**********************************************************************
52  * create_fx_win
53  *
54  * Create the fx window used to show the fit.
55  **********************************************************************/
56 
create_fx_win()57 void create_fx_win() {  //make features win
58   fx_win = new ScrollView (FXDEMOWIN,
59     FXDEMOXPOS, FXDEMOYPOS, FXDEMOXSIZE, FXDEMOYSIZE,
60     WERDWIDTH*2, BLN_MAX*2, true);
61 }
62 
63 
64 /**********************************************************************
65  * clear_fx_win
66  *
67  * Clear the fx window and draw on the base/mean lines.
68  **********************************************************************/
69 
clear_fx_win()70 void clear_fx_win() {  //make features win
71   fx_win->Clear();
72   fx_win->Pen(64,64,64);
73   fx_win->Line(-WERDWIDTH, bln_baseline_offset, WERDWIDTH, bln_baseline_offset);
74   fx_win->Line(-WERDWIDTH, bln_x_height + bln_baseline_offset, WERDWIDTH, bln_x_height + bln_baseline_offset);
75 }
76 
77 #endif //GRAPHICS_DISABLED
78 
79 /**********************************************************************
80  * create_fxdebug_win
81  *
82  * Create the fx window used to show the fit.
83  **********************************************************************/
84 
create_fxdebug_win()85 void create_fxdebug_win() {  //make gradients win
86   //      if (strcmp(fx_debugfile.string(),DEBUG_WIN_NAME)==0)
87   //              fx_debug=create_debug_window(fx_debugfile.string(),
88   //                      DEBUG_XPOS,DEBUG_YPOS,
89   //                      DEBUG_XSIZE,DEBUG_YSIZE);
90   //      else
91   //              fx_debug=fopen(fx_debugfile.string(),"w");
92 }
93