source: tspsg-svn/trunk/src/globals.h @ 79

Last change on this file since 79 was 78, checked in by laleppa, 15 years ago

+ Added an ability to disable showing of the solution steps' matrices in solution output.

  • Replaced Ok and Cancel buttons in SettingsDialog? with QButtonBox. Now the buttons conform the interface guidelines of the target platform.
  • Increased the allowed maximum number of cities to 50. Solution steps' matrices aren't shown by default if the number of cities in task is more than 15.
  • For WinCE the size of the toolbar buttons is now determined based on the device DPI instead of its resolution.
  • Open and save file dialogs are now using native dialogs where supported.
  • Reworked About dialog a little bit.
  • Property svn:keywords set to Id URL
File size: 3.6 KB
Line 
1/*!
2 * \file globals.h
3 * \author Copyright (C) 2007-2009 Lёppa <contacts[at]oleksii[dot]name>
4 *
5 *  $Id: globals.h 78 2009-12-18 12:57:39Z laleppa $
6 *  $URL: https://tspsg.svn.sourceforge.net/svnroot/tspsg/trunk/src/globals.h $
7 *
8 * \brief Contains TSPSG global defines.
9 *
10 *  <b>TSPSG: TSP Solver and Generator</b>
11 *
12 *  This file is part of TSPSG.
13 *
14 *  TSPSG is free software: you can redistribute it and/or modify
15 *  it under the terms of the GNU General Public License as published by
16 *  the Free Software Foundation, either version 3 of the License, or
17 *  (at your option) any later version.
18 *
19 *  TSPSG is distributed in the hope that it will be useful,
20 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
21 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22 *  GNU General Public License for more details.
23 *
24 *  You should have received a copy of the GNU General Public License
25 *  along with TSPSG.  If not, see <http://www.gnu.org/licenses/>.
26 */
27
28#ifndef GLOBALS_H
29#define GLOBALS_H
30
31// INCLUDES
32#include <QtCore>
33#include <QtGui>
34
35// Version info
36#include "version.h"
37// OS and ARCH detection
38#include "os.h"
39
40// DEFINES
41// Default values
42//! Default minimum for random numbers generation
43#define DEF_RAND_MIN 1
44//! Default maximum for random numbers generation
45#define DEF_RAND_MAX 10
46//! Default number of cities
47#define DEF_NUM_CITIES 5
48//! Default value for showing or not solution step matrices
49#define DEF_SHOW_MATRIX true
50//! Default value for using or not city limit for showing solution steps matrices
51#define DEF_USE_SHOW_MATRIX_LIMIT true
52//! Default maximum number of cities to show solution step matrices
53#define DEF_SHOW_MATRIX_CITY_LIMIT 15
54//! Default font name
55#define DEF_FONT_FAMILY "Courier New"
56//! Default font size
57#define DEF_FONT_SIZE 10
58//! Default font color
59#define DEF_FONT_COLOR Qt::black
60
61//! Maximum available number of cities
62#define MAX_NUM_CITIES 50
63//! Maximum allowed value for random generation limits
64#define MAX_RAND_VALUE 1000
65
66// Paths
67/*!
68 * \def PATH_I18N
69 * \brief Bath to internationalization files.
70 */
71/*!
72 * \def PATH_DOCS
73 * \brief Bath to documentation files.
74 */
75#if defined(Q_OS_LINUX) || defined(Q_OS_UNIX)
76        #define PATH_I18N "/usr/share/tspsg/i18n"
77        #define PATH_DOCS "/usr/share/doc/tspsg"
78#else
79        #define PATH_I18N "i18n"
80        #define PATH_DOCS "help"
81#endif // Q_OS_LINUX
82
83//! TSPSG Task file signature - letters \c TSPT
84#define TSPT quint32(0x54535054)
85//! TSPSG Task file version
86#define TSPT_VERSION quint8(1)
87//! TSPSG Task file metadata version
88#define TSPT_META_VERSION quint8(1)
89//! TSPSG Task file metadata size in bytes (incl. version)
90#define TSPT_META_SIZE 2
91//! ZKomModRd Task file signature - letters \c ZK
92#define ZKT quint16(0x5A4B)
93//! ZKomModRd Task file version
94#define ZKT_VERSION quint8(1)
95
96/*!
97 * \def INFINITY
98 * \brief This value means infinity :-)
99 *
100 *  Some libraries already have \c INFINITY defined.
101 *  We need to redefine it for the \c INFINITY to always have the same value.
102 */
103#ifdef INFINITY
104        #undef INFINITY
105#endif
106#define INFINITY 1.7E+308
107//! This string represents infinite value in the table
108#define INFSTR "---"
109
110// Sanity checks
111// Check that default number of cities is sane (<= MAX_NUM_CITIES)
112#if DEF_NUM_CITIES > MAX_NUM_CITIES
113        #undef DEF_NUM_CITIES
114        #define DEF_NUM_CITIES MAX_NUM_CITIES
115#endif
116// Check that maximum for random generation is sane (<= MAX_RAND_VALUE)
117#if DEF_RAND_MAX > MAX_RAND_VALUE
118        #undef DEF_RAND_MAX
119        #define DEF_RAND_MAX MAX_RAND_VALUE
120#endif
121// Check that DEF_RAND_MIN <= DEF_RAND_MAX
122#if DEF_RAND_MIN > DEF_RAND_MAX
123        #undef DEF_RAND_MIN
124        #define DEF_RAND_MIN DEF_RAND_MAX
125#endif
126
127#endif // GLOBALS_H
Note: See TracBrowser for help on using the repository browser.