Go to the documentation of this file.00001 #ifndef CONSTANTS_H_4125434583252
00002 #define CONSTANTS_H_4125434583252
00003
00004
00005
00006
00007
00008 #define PROGRAM_NAME "Automata editor"
00009
00010
00011 #define PROGRAM_VERSION "2.0"
00012
00013
00014
00015 #ifndef GRAPHVIZ_VERSION
00016 # ifdef WIN32
00017 # define GRAPHVIZ_VERSION "2.26.3"
00018 # else
00019 # define GRAPHVIZ_VERSION "2.20.2"
00020 # endif
00021 #endif
00022
00023
00024
00025 #ifndef QT_OPENGL_LIB
00026 # define DONT_USE_OPENGL_RENDERING // TODO: still only experimental usage
00027 #endif
00028
00029 #ifndef QT_SVG_LIB
00030 # define DONT_USE_SVG_MODULE
00031 #endif
00032
00033
00034
00035
00036
00037 #define TESTING
00038
00039 #ifdef TESTING
00040
00041
00042 # define TESTING_STRING_PROCESSOR
00043
00044 # define TESTING_PARSER
00045
00046 # define TESTING_SERIALIZERS
00047 # define TESTING_ADDING
00048 # define TESTING_AUTOMATA_CREATOR
00049 # define TESTING_DRAWING
00050 # define TESTING_AUTOMATA_INTERFACES
00051
00052 # define TESTING_SIMULATION
00053 # define TESTING_SYNTAX_CHECKER
00054 # define TESTING_GRAPHVIZDRAWER
00055 #endif
00056
00057 #ifdef TESTING_PAINTING
00058 # define TESTING_BOUNDING_RECT_PAINTING
00059 #endif
00060
00061 #ifdef TESTING_SIMULATION
00062
00063
00064
00065
00066
00067 #endif
00068
00069 #include "dbglog.h"
00070
00071 #ifdef TESTING_AUTOMATA_INTERFACES
00072 # define DBGLOG_AI(x) DBGLOG_("IAUTOMATA", x)
00073 #else
00074 # define DBGLOG_AI(x)
00075 #endif
00076
00077
00078 #define PERFORMANCE_MEASUREMENT
00079
00080 #ifdef PERFORMANCE_MEASUREMENT
00081
00082
00083
00084 # define MEASURE_PARSER_RUN
00085 #endif
00086
00087 #ifdef TESTING_STRING_PROCESSOR
00088
00089
00090 #endif
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100 #define SNAP_TO_GRID false
00101 #define SHOW_GRID true
00102 #define SHOW_FRAME true
00103 #define INIT_ANTIALIASING false
00104
00105
00106
00107 #define INIT_ACTION 0 // == Editor::eSelection
00108
00109
00110 #define DEFAULT_SUFFIX_VCG false // if false, then "*.tex" is used
00111
00112
00113
00114 #define CLIPBOARD_FORMAT_STATE "application/AutotmataEditor;type=State"
00115 #define CLIPBOARD_FORMAT "application/AutomataEditor;type=Selection"
00116
00117
00118 enum {LLX=0, LLY=0, URX=12, URY=10};
00119
00120
00121 enum {Z_STATE, Z_TRANSITION, Z_TR_LABEL};
00122
00123
00124
00125
00126 #define CLICK_BOUNDS 2
00127 #define SELECTION_BOUNDS 4
00128
00129
00130
00131 enum {NORTH, SOUTH, EAST, WEST, NORTH_EAST, NORTH_WEST, SOUTH_EAST, SOUTH_WEST};
00132
00133
00134 enum {GRID_STEP=40};
00135
00136
00137 #define ZOOM_DIVIDER 600.0 //!< \note hold this in multiples of 120.0 according to Qt documentation of wheelEvent
00138
00139
00140 enum {S_LX = -18, S_LY = -18, S_W = -2*S_LX, S_H = -2*S_LY};
00141
00142
00143 enum {VAR_STATE_R_X = 20, VAR_STATE_R_Y = 50, VAR_STATE_R_X_DBL=25,
00144 VAR_STATE_WIDTH_ADDITION = 20};
00145
00146
00147
00148 #define ARROW_LEN 10
00149 #define ARROW_WIDTH 6
00150
00151
00152
00153 #define TR_SE_LENGTH 40
00154
00155
00156
00157 #define TR_LOOP_OPENING_ANGLE 30 //!< angles according to VCManual
00158 #define TR_CLOOP_OPENING_ANGLE 22
00159 #define TR_LOOPVAR_OPENING_ANGLE 28
00160 #define TR_LOOP_MULTIPLICATOR 3.5f //!< for loop construction - length of constructional line - empiric constant
00161
00162
00163
00164 #define TEXT_DISTANCE 5.f
00165
00166
00167
00168 #define TR_LINE_VIEW_COEF 2.f
00169 #define STATE_LINE_VIEW_COEF 1.6f
00170 #define STATE_DOUBLE_LINE_VIEW_COEF 1.4f
00171
00172
00173
00174 enum {UNDO_LIMIT=0};
00175
00176
00177 enum {MAX_RECT_VALUE = 500, MIN_RECT_VALUE = -MAX_RECT_VALUE};
00178
00179 enum {SCENE_BORDER=100, MIN_BORDER_VALUE=10, MAX_BORDER_VALUE=500};
00180
00181
00182
00183 namespace CheckedColor { enum {r=255, g=100, b=100, a=255}; };
00184 namespace SelectedColor { enum {r=100, g=100, b=100, a=200}; };
00185
00186
00187
00188 #define NEW_FILENAME (DEFAULT_SUFFIX_VCG ? "untitled.vcg" : "untitled.tex")
00189
00190
00191 enum {SBS_STATES = 3, SBS_TRAN = 2, SBS_IF = 4, SBS_LABELS = 3};
00192
00193
00194 enum {EXACT_HSPACE = 2,
00195 HAMMING_HSPACE = 2, HAMMING_VSPACE= 2,
00196 LEVEN_HSPACE = 3, LEVEN_VSPACE = 3};
00197
00198
00199
00200 #define DEF_EDGE_LAB_POS 0.45f
00201 #define DEF_ARC_LAB_POS 0.4f
00202 #define DEF_LOOP_LAB_POS 0.25f
00203 #define DEF_TR_S_DIR WEST
00204 #define DEF_TR_E_DIR EAST
00205 #define DEF_ARC_ANGLE 30
00206 #define DEF_VCURV_ANGLE 0
00207 #define DEF_VCURV_ANGLE_B 180
00208 #define DEF_VCURVR_ANGLE_B 0 //!< probably bug in VauCanSon package, VCurveR has angleB default on 0
00209 #define DEF_ARC_CURV 0.8f
00210 #define DEF_VCURV_CURV 1.0f
00211
00212
00213
00214
00215 #define DEF_LINE_STYLE Qt::SolidLine
00216 #define DEF_STATE_LINE_WIDTH 1.8f
00217 #define DEF_EDGE_LINE_WIDTH 1.f
00218 #define DEF_COLOR "black"
00219 #define DEF_LABEL_SCALE 1.7f
00220 #define DEF_FILL_STATUS Qt::SolidPattern
00221 #define DEF_FILL_COLOR "white"
00222 #define DEF_EDGE_LINE_DBL_STATUS false
00223
00224 #define DEF_DIM_LINE_STYLE Qt::SolidLine
00225 #define DEF_DIM_COLOR "gray"
00226 #define DEF_DIM_STATE_LINE_COEF 1.0f
00227 #define DEF_DIM_EDGE_LINE_COEF 1.2f
00228 #define DEF_DIM_FILL_COLOR "white"
00229
00230 #define DEF_STATE_LINE_DBL_COEF 0.6f
00231 #define DEF_STATE_LINE_DBL_SEP 0.4f
00232 #define DEF_EDGE_LINE_BORDER_COEF 2
00233 #define DEF_EDGE_LINE_BORDER_COLOR "white"
00234
00235 #define DEF_EDGE_LINE_DBL_COEF 0.5f
00236 #define DEF_EDGE_LINE_DBL_SEP 0.6f
00237
00238 #define STATE_LABEL_SIZE 10
00239 #define EDGE_LABEL_SIZE 10
00240
00241
00242
00243 #define M_PI 3.1415926535
00244
00245
00246
00247 #define EPS_FONT_SIZE_MULTIPLIER 1.4f
00248
00249 #define SCRIPT_STYLE_MULT 0.75f
00250 #define SCRIPT_SCRIPT_STYLE_MULT 0.7f
00251
00252 #ifdef USE_UNKNOWN_CONVENTION
00253 # define UNKNOWN_CHARACTER '?'
00254 # define UNKNOWN_STRING "\\unknown"
00255 #endif
00256
00257
00258
00259
00260 #define SIMULATION_STEP_DEFAULT 1.0 //!< unit: seconds
00261 #define SIMULATION_STEP_MIN 0.5
00262 #define SIMULATION_STEP_MAX 10.0
00263
00264 #define USE_ANIMS_BY_DEFAULT true
00265 #define ANIM_SPEED_DEFAULT 500.0 //!< unit: miliseconds
00266 #define ANIM_SPEED_MIN 100.0
00267 #define ANIM_SPEED_MAX 10000.0
00268 #define ANIMATION_FRAME_TIME 40.0f //!< correspodns to 25fps
00269
00270
00271 #define RESET_UNDO_STACK_AFTER_SIMULATION
00272
00273
00274 #endif