• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

C:/CVUT/diplomka/Automata_editor/sources/constants.h

Go to the documentation of this file.
00001 #ifndef CONSTANTS_H_4125434583252
00002 #define CONSTANTS_H_4125434583252
00003 
00004 //! \file constants.h
00005 //! Contains all constants and editor's settings.
00006 
00007 //! name of this program
00008 #define PROGRAM_NAME                "Automata editor"
00009 
00010 //! current version of editor
00011 #define PROGRAM_VERSION             "2.0"
00012 
00013 // TODO: define some version macros to make gvwrapper supporting more then just one version
00014 //! set GraphViz library version, which will be required in runtime (can be reset in sources.pro)
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 // if defined, no OpenGL rendering is used
00024 // note: do NOT define QT_* macros manually, they are set by qmake depending on enabled modules
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 // if defined, undefined characters are displayed as UNKNOWN_CHARACTER and undefined strings are displayed as UNKNOWN_STRING
00034 // #define USE_UNKNOWN_CONVENTION
00035 
00036 // if defined, editor is in TESTING mode (== verbose mode + special painting)
00037 #define TESTING
00038 
00039 #ifdef TESTING
00040 //#   define TESTING_MOUSE_EVENTS
00041 //#   define TESTING_ARROW_POINTS
00042 #   define TESTING_STRING_PROCESSOR
00043 //#   define TESTING_LEXER
00044 #   define TESTING_PARSER
00045 //#   define TESTING_PAINTING
00046 #   define TESTING_SERIALIZERS
00047 #   define TESTING_ADDING
00048 #   define TESTING_AUTOMATA_CREATOR
00049 #   define TESTING_DRAWING
00050 #   define TESTING_AUTOMATA_INTERFACES
00051 //#   define TESTING_USE_SMALLER_WINDOW
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 // if defined, every step of animation process is logged
00063 //#   define TESTING_ANIMATIONS
00064 
00065 // if defined, undo view is available while simulation is runnig (don't change undostack index !!!)
00066 //#   define ALLOW_UNDO_VIEW_WHILE_SIMULATION_RUNNING
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 // #if defined, performance measurement is active
00078 #define PERFORMANCE_MEASUREMENT
00079 
00080 #ifdef PERFORMANCE_MEASUREMENT
00081 //#   define MEASURE_CREATE_STROKES
00082 //#   define MEASURE_TR_ADJUST
00083 //#   define MEASURE_AUTOMATA_RECONGIZATION
00084 #   define MEASURE_PARSER_RUN
00085 #endif
00086 
00087 #ifdef TESTING_STRING_PROCESSOR
00088 // if defined, StringProcessorTestDialog will be showed on program start up
00089 //#   define STRING_PROCESSOR_TEST
00090 #endif
00091 
00092 // debugging printouts turn on(==commented)/off
00093 //#define QT_NO_DEBUG_OUTPUT
00094 
00095 // warning printouts turn on(==commented)/off
00096 //#define QT_NO_WARNING_OUTPUT
00097 
00098 //! \name start settings
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 //! init action (Editor::EAction)
00107 #define INIT_ACTION                 0 // == Editor::eSelection
00108 
00109 //! default save suffix
00110 #define DEFAULT_SUFFIX_VCG          false // if false, then "*.tex" is used
00111 
00112 //! \name clipboards formats
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}; //!< default grid proportions
00119 
00120 //! ZValues
00121 enum {Z_STATE, Z_TRANSITION, Z_TR_LABEL};
00122 
00123 //! \name areas bounds
00124 //! used when creating click and selection areas using path stroker
00125 //! \{
00126 #define CLICK_BOUNDS                2
00127 #define SELECTION_BOUNDS            4
00128 //! \}
00129 
00130 //! directions
00131 enum {NORTH, SOUTH, EAST, WEST, NORTH_EAST, NORTH_WEST, SOUTH_EAST, SOUTH_WEST};
00132 
00133 //! grid step
00134 enum {GRID_STEP=40};
00135 
00136 //! zooming divider
00137 #define ZOOM_DIVIDER 600.0 //!< \note hold this in multiples of 120.0 according to Qt documentation of wheelEvent
00138 
00139 //! normal state size proportions
00140 enum {S_LX = -18, S_LY = -18, S_W = -2*S_LX, S_H = -2*S_LY};
00141 
00142 //! radices of StateVar
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 //! \name arrow size
00147 //! \{
00148 #define ARROW_LEN                   10
00149 #define ARROW_WIDTH                 6
00150 //! \}
00151 
00152 //! transition initial/final line length
00153 #define TR_SE_LENGTH                40
00154 
00155 //! \name transition loop parameters
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 //! transition text distnace
00164 #define TEXT_DISTANCE               5.f
00165 
00166 //! \name view transformations
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 //! undo and redo setting
00174 enum {UNDO_LIMIT=0}; //!< \note for no limit set 0
00175 
00176 //! gridRect's size limit
00177 enum {MAX_RECT_VALUE = 500, MIN_RECT_VALUE = -MAX_RECT_VALUE};
00178 //! scene border (only editor setting)
00179 enum {SCENE_BORDER=100, MIN_BORDER_VALUE=10, MAX_BORDER_VALUE=500};
00180 
00181 //! \name colors
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 //! default export format
00188 #define NEW_FILENAME (DEFAULT_SUFFIX_VCG ? "untitled.vcg" : "untitled.tex")
00189 
00190 //! number of side by side states and transitions in VauCanSon-G
00191 enum {SBS_STATES = 3, SBS_TRAN = 2, SBS_IF = 4, SBS_LABELS = 3}; 
00192 
00193 //! searching automata generation options
00194 enum {EXACT_HSPACE = 2,
00195       HAMMING_HSPACE = 2, HAMMING_VSPACE= 2,
00196       LEVEN_HSPACE = 3, LEVEN_VSPACE = 3};
00197 
00198 //! \name default values of transitions
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 //! \name default style values
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 //! math custom constant
00243 #define M_PI 3.1415926535
00244 
00245 //! \name StringProcessor settings
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 //! Simulation settings
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 // if defined, undo stack is reset when simulation dialog is closed (to reduce stack size)
00271 #define RESET_UNDO_STACK_AFTER_SIMULATION
00272 //! \}
00273 
00274 #endif

Generated on Tue Jan 4 2011 03:03:22 for Autoamata editor by  doxygen 1.7.0