source: tspsg/src/globals.h @ bc1b8837b6

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

Started documenting the source code in doxygen format.

  • Property mode set to 100644
File size: 3.2 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
[bc1b8837b6]78//! TSPSG Task file signature - letters \p 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
[bc1b8837b6]86//! ZKomModRd Task file signature - letters \p ZK
[993d5af6f6]87#define ZKT quint16(0x5A4B)
[bc1b8837b6]88//! ZKomModRd Task file version
[993d5af6f6]89#define ZKT_VERSION quint8(1)
90
[bc1b8837b6]91// Some libraries already have INFINITY defined.
92// We need to undefine it for INFINITY to have always the same value.
93#ifdef INFINITY
94        #undef INFINITY
[5587b87fac]95#endif
[bc1b8837b6]96//! This value means infinity :-)
97#define INFINITY 1.7E+308
98//! This string represents infinite value in the table
[430bd7f7e9]99#define INFSTR "---"
[5587b87fac]100
[bc1b8837b6]101// Sanity checks
[2fb523720a]102// Check that default number of cities is sane (<= MAX_NUM_CITIES)
[aaf2113307]103#if DEF_NUM_CITIES > MAX_NUM_CITIES
104        #undef DEF_NUM_CITIES
105        #define DEF_NUM_CITIES MAX_NUM_CITIES
106#endif
[2fb523720a]107// Check that maximum for random generation is sane (<= MAX_RAND_VALUE)
108#if DEF_RAND_MAX > MAX_RAND_VALUE
109        #undef DEF_RAND_MAX
110        #define DEF_RAND_MAX MAX_RAND_VALUE
111#endif
112// Check that DEF_RAND_MIN <= DEF_RAND_MAX
113#if DEF_RAND_MIN > DEF_RAND_MAX
114        #undef DEF_RAND_MIN
115        #define DEF_RAND_MIN DEF_RAND_MAX
116#endif
[aaf2113307]117
[993d5af6f6]118#endif // GLOBALS_H
Note: See TracBrowser for help on using the repository browser.