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
RevLine 
[aecdf994f9]1/*
[430bd7f7e9]2 *  TSPSG: TSP Solver and Generator
[d5384ee64e]3 *  Copyright (C) 2007-2009 Lёppa <contacts[at]oleksii[dot]name>
[aecdf994f9]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
[993d5af6f6]24#ifndef GLOBALS_H
25#define GLOBALS_H
[aecdf994f9]26
[bc1b8837b6]27/*!
28 * \file globals.h
29 * \brief This file contains TSPSG global defines.
30 */
31
[993d5af6f6]32// INCLUDES
33#include <QtCore>
34#include <QtGui>
35
[430bd7f7e9]36// Version info
37#include "version.h"
[c10297cf73]38// OS and ARCH detection
[993d5af6f6]39#include "os.h"
40
41// DEFINES
[aecdf994f9]42// Default values
[bc1b8837b6]43//! Default minimum for random numbers generation
[aecdf994f9]44#define DEF_RAND_MIN 1
[bc1b8837b6]45//! Default maximum for random numbers generation
[aecdf994f9]46#define DEF_RAND_MAX 10
[bc1b8837b6]47//! Default number of cities
[aaf2113307]48#define DEF_NUM_CITIES 5
[bc1b8837b6]49//! Default font name
[aecdf994f9]50#define DEF_FONT_FAMILY "Courier New"
[bc1b8837b6]51//! Default font size
[430bd7f7e9]52#define DEF_FONT_SIZE 10
[bc1b8837b6]53//! Default font color
[aecdf994f9]54#define DEF_FONT_COLOR Qt::black
55
[bc1b8837b6]56//! Maximum available number of cities
[2fb523720a]57#define MAX_NUM_CITIES 30
[bc1b8837b6]58//! Maximum allowed value for random generation limits
[2fb523720a]59#define MAX_RAND_VALUE 1000
60
61// Paths
[bc1b8837b6]62/*!
63 * \def PATH_I18N
64 * \brief Bath to internationalization files.
65 */
66/*!
67 * \def PATH_DOCS
68 * \brief Bath to documentation files.
69 */
[2fb523720a]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
[85ad815b0b]78//! TSPSG Task file signature - letters \c TSPT
[993d5af6f6]79#define TSPT quint32(0x54535054)
[bc1b8837b6]80//! TSPSG Task file version
[993d5af6f6]81#define TSPT_VERSION quint8(1)
[bc1b8837b6]82//! TSPSG Task file metadata version
[993d5af6f6]83#define TSPT_META_VERSION quint8(1)
[bc1b8837b6]84//! TSPSG Task file metadata size in bytes (incl. version)
[993d5af6f6]85#define TSPT_META_SIZE 2
[85ad815b0b]86//! ZKomModRd Task file signature - letters \c ZK
[993d5af6f6]87#define ZKT quint16(0x5A4B)
[bc1b8837b6]88//! ZKomModRd Task file version
[993d5af6f6]89#define ZKT_VERSION quint8(1)
90
[85ad815b0b]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 */
[bc1b8837b6]98#ifdef INFINITY
99        #undef INFINITY
[5587b87fac]100#endif
[bc1b8837b6]101#define INFINITY 1.7E+308
102//! This string represents infinite value in the table
[430bd7f7e9]103#define INFSTR "---"
[5587b87fac]104
[bc1b8837b6]105// Sanity checks
[2fb523720a]106// Check that default number of cities is sane (<= MAX_NUM_CITIES)
[aaf2113307]107#if DEF_NUM_CITIES > MAX_NUM_CITIES
108        #undef DEF_NUM_CITIES
109        #define DEF_NUM_CITIES MAX_NUM_CITIES
110#endif
[2fb523720a]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
[aaf2113307]121
[993d5af6f6]122#endif // GLOBALS_H
Note: See TracBrowser for help on using the repository browser.