r570: no message
[ctsim.git] / src / tips.cpp
1 /*****************************************************************************
2 ** FILE IDENTIFICATION
3 **
4 **   Name:          tips.cpp
5 **   Purpose:       User tips for CTSim
6 **   Programmer:    Kevin Rosenberg
7 **   Date Started:  February 2001
8 **
9 **  This is part of the CTSim program
10 **  Copyright (C) 1983-2001 Kevin Rosenberg
11 **
12 **  $Id: tips.cpp,v 1.1 2001/02/22 00:56:50 kevin Exp $
13 **
14 **  This program is free software; you can redistribute it and/or modify
15 **  it under the terms of the GNU General Public License (version 2) as
16 **  published by the Free Software Foundation.
17 **
18 **  This program is distributed in the hope that it will be useful,
19 **  but WITHOUT ANY WARRANTY; without even the implied warranty of
20 **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 **  GNU General Public License for more details.
22 **
23 **  You should have received a copy of the GNU General Public License
24 **  along with this program; if not, write to the Free Software
25 **  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26 ******************************************************************************/
27
28 #ifdef MSVC
29 #define strdup _strdup
30 #endif
31
32 // For compilers that support precompilation, includes "wx/wx.h".
33 #include "wx/wxprec.h"
34
35 #ifdef __BORLANDC__
36 #pragma hdrstop
37 #endif
38
39 #ifndef WX_PRECOMP
40 #include "wx/wx.h"
41 #endif
42
43
44 #include "tips.h"
45
46 #if defined(HAVE_CONFIG_H)
47 #include "config.h"
48 #endif
49
50
51 const char* const CTSimTipProvider::s_aszTips[] = {
52   {"You can create a geometric phantom using the \"File - Create Phantom\" menu command."},
53   {"You can create a gray-scale, rasterized image of a phantom by using the \"Process - Rasterize\" menu command on a geometric phantom."},
54   {"You can simulate the x-ray process by using the \"Process - Projections\" menu command on a geometric phantom."},
55   {"You can simulate first, second, and third-fourth-fifth generation CT scanners by using different scanner geometries."},
56   {"You can reconstruct an image from the x-ray data by using the \"Reconstruction\" menu on a projection file."},
57   {"You can specify different levels of smoothing by using different filters in the \"Reconstruction\" dialog."},
58   {"You can select a row and column of an image by left-mouse button clicking on an image."},
59   {"You can plot a column or row of an image by using the \"Analyze - Plot\" command."},
60   {"You can save your plots to a disk file by using the \"File - Save\" command."},
61   {"You can create your own phantoms using a text editor. Please see the manual for the simple file format."},
62   {"You can perform 2-dimension Fourier transform of images using the \"Filter\" menu commands."},
63   {"You can create an image of a filter by using the \"File - Create Filter\" menu command."},
64   {"You can add two images by using the \"Image - Add\" menu command."},
65   {"You can display the value of a pixel in an image by right-mouse button clicking on an image."},
66   {"You can view a 3-dimensional view of an image using the \"Image - 3D\" menu command."},
67   {"You can scale an image to any size using the \"Image - Scale Size\" menu command."},
68   {"You can display context-sensitive help by using the \"Help\" button on dialog boxes."},
69   {"You can compare two images by using the \"Analyze - Compare Images\" menu command."},
70   {"You can display these tips at any time by using the \"Help - Tips\" menu command."},
71   {"You can control CTSim's operation using the \"File - Preferences\" menu command."},
72 };
73
74 const int CTSimTipProvider::s_iNumTips = sizeof(s_aszTips) / sizeof(const char *);
75
76
77 CTSimTipProvider::CTSimTipProvider (size_t iCurrentTip)
78 : wxTipProvider (iCurrentTip)
79 {
80   if (iCurrentTip >= s_iNumTips)
81     iCurrentTip = 0;
82
83   m_iCurrentTip = iCurrentTip;
84 }
85
86 wxString
87 CTSimTipProvider::GetTip()
88 {
89   if (m_iCurrentTip >= s_iNumTips)
90     m_iCurrentTip = 0;
91
92   size_t iThisTip = m_iCurrentTip;
93   ++m_iCurrentTip;
94
95   return wxString (s_aszTips[iThisTip]);
96 }
97
98 size_t
99 CTSimTipProvider::GetCurrentTip()
100 {
101   if (m_iCurrentTip >= s_iNumTips)
102     m_iCurrentTip = 0;
103
104   return m_iCurrentTip;
105 }
106