X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fbase%2Frs.h;h=6d7424af77e0df9d4563121fda643c66b3a748b4;hb=27d4a138d23453e93a833e9347444b828a971cb4;hp=60a8f057c0883da34d307ac33ec3a5141a2ae224;hpb=16ce54abf01ca3032e42a5bb11a4afcf9014dcca;p=architektonas diff --git a/src/base/rs.h b/src/base/rs.h index 60a8f05..6d7424a 100644 --- a/src/base/rs.h +++ b/src/base/rs.h @@ -568,7 +568,6 @@ Qt::AltButton Qt::AltModifier Qt::MetaButton Qt::MetaModifier Qt::Keypad Qt::KeypadModifier Qt::KeyButtonMask Qt::KeyboardModifierMask -#endif /** * Mouse button and keyboard state for mouse events. */ @@ -585,7 +584,10 @@ Qt::KeyButtonMask Qt::KeyboardModifierMask KeyButtonMask = Qt::KeyboardModifierMask, Keypad = Qt::KeypadModifier }; +#endif +//get rid of unnecessary shiaut like this: +#if 0 /** * Wrapper for Qt */ @@ -601,6 +603,7 @@ Qt::KeyButtonMask Qt::KeyboardModifierMask // return (RS2::ButtonState)t; // } static RS2::ButtonState qtToRsButtonState(int t) { return (RS2::ButtonState)t; } +#endif /** * Enum of line styles: @@ -690,8 +693,10 @@ Qt::KeyButtonMask Qt::KeyboardModifierMask /** * Wrapper for Qt. */ - static RS2::LineType qtToRsPenStyle(Qt::PenStyle s) { - switch (s) { + static RS2::LineType qtToRsPenStyle(Qt::PenStyle s) + { + switch (s) + { case Qt::NoPen: return NoPen; case Qt::SolidLine: @@ -713,14 +718,16 @@ Qt::KeyButtonMask Qt::KeyboardModifierMask return SolidLine; break; } - return SolidLine; + + return SolidLine; } /** * \brief Struct that stores a line type pattern (e.g. dash dot dot). */ - struct LineTypePatternStruct { - double* pattern; + struct LineTypePatternStruct + { + double * pattern; int num; } LineTypePattern; @@ -761,128 +768,114 @@ Qt::KeyButtonMask Qt::KeyboardModifierMask /** * Wrapper for Qt */ - /* - static int qw(RS2::LineWidth w) { - switch (w) { - case Width00: - return 1; // 0 is more accurate but quite slow - break; - case WidthByLayer: - case WidthByBlock: - case WidthDefault: - return 1; - break; - case Width01: - case Width02: - case Width03: - case Width04: - case Width05: - case Width06: - case Width07: - case Width08: - return 1; - break; - case Width09: - case Width10: - return 3; - break; - case Width11: - return 4; - break; - case Width12: - case Width13: - return 5; - break; - case Width14: - return 6; - break; - case Width15: - return 7; - break; - case Width16: - return 8; - break; - case Width17: - return 9; - break; - case Width18: - case Width19: - return 10; - break; - case Width20: - return 12; - break; - case Width21: - case Width22: - case Width23: - //case Width24: - return 14; - break; - default: - return (int)w; - break; - } - return (int)w; - } - */ - - /** - * Wrapper for Qt - */ - static LineWidth intToLineWidth(int w) { - if (w==-3) { + static LineWidth intToLineWidth(int w) + { + if (w == -3) + { return WidthDefault; - } else if (w==-2) { + } + else if (w == -2) + { return WidthByBlock; - } else if (w==-1) { + } + else if (w == -1) + { return WidthByLayer; - } else if (w<3) { + } + else if (w < 3) + { return Width00; - } else if (w<8) { + } + else if (w < 8) + { return Width01; - } else if (w<12) { + } + else if (w < 12) + { return Width02; - } else if (w<14) { + } + else if (w < 14) + { return Width03; - } else if (w<17) { + } + else if (w < 17) + { return Width04; - } else if (w<19) { + } + else if (w < 19) + { return Width05; - } else if (w<23) { + } + else if (w < 23) + { return Width06; - } else if (w<28) { + } + else if (w < 28) + { return Width07; - } else if (w<33) { + } + else if (w < 33) + { return Width08; - } else if (w<38) { + } + else if (w < 38) + { return Width09; - } else if (w<46) { + } + else if (w < 46) + { return Width10; - } else if (w<52) { + } + else if (w < 52) + { return Width11; - } else if (w<57) { + } + else if (w < 57) + { return Width12; - } else if (w<66) { + } + else if (w < 66) + { return Width13; - } else if (w<76) { + } + else if (w < 76) + { return Width14; - } else if (w<86) { + } + else if (w < 86) + { return Width15; - } else if (w<96) { + } + else if (w < 96) + { return Width16; - } else if (w<104) { + } + else if (w < 104) + { return Width17; - } else if (w<114) { + } + else if (w < 114) + { return Width18; - } else if (w<131) { + } + else if (w < 131) + { return Width19; - } else if (w<150) { + } + else if (w < 150) + { return Width20; - } else if (w<180) { + } + else if (w < 180) + { return Width21; - } else if (w<206) { + } + else if (w < 206) + { return Width22; - } else { + } + else + { return Width23; } } @@ -917,8 +910,10 @@ Qt::KeyButtonMask Qt::KeyboardModifierMask /** * Wrapper for Qt. */ - static Qt::CursorShape rsToQtCursorType(RS2::CursorType t) { - switch (t) { + static Qt::CursorShape rsToQtCursorType(RS2::CursorType t) + { + switch (t) + { case ArrowCursor: return Qt::ArrowCursor; break; @@ -971,7 +966,8 @@ Qt::KeyButtonMask Qt::KeyboardModifierMask return Qt::ArrowCursor; break; } - return Qt::ArrowCursor; + + return Qt::ArrowCursor; } /** @@ -1015,10 +1011,12 @@ Qt::KeyButtonMask Qt::KeyboardModifierMask /** * Wrapper for Qt. */ - static QPrinter::PageSize rsToQtPaperFormat(RS2::PaperFormat f) { + static QPrinter::PageSize rsToQtPaperFormat(RS2::PaperFormat f) + { QPrinter::PageSize ret; - switch (f) { + switch (f) + { case Custom: ret = QPrinter::Custom; break;