source: tspsg/src/globals.h @ 85ad815b0b

0.1.3.145-beta1-symbian0.1.4.170-beta2-bb10appveyorimgbotreadme
Last change on this file since 85ad815b0b was 85ad815b0b, checked in by Oleksii Serdiuk, 15 years ago

Some documentation updates.

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