Qt::MetaButton Qt::MetaModifier
Qt::Keypad Qt::KeypadModifier
Qt::KeyButtonMask Qt::KeyboardModifierMask
-#endif
/**
* Mouse button and keyboard state for mouse events.
*/
KeyButtonMask = Qt::KeyboardModifierMask,
Keypad = Qt::KeypadModifier
};
+#endif
+//get rid of unnecessary shiaut like this:
+#if 0
/**
* Wrapper for Qt
*/
// return (RS2::ButtonState)t;
// }
static RS2::ButtonState qtToRsButtonState(int t) { return (RS2::ButtonState)t; }
+#endif
/**
* Enum of line styles:
/**
* 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:
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;
/**
* 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;
}
}
/**
* 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;
return Qt::ArrowCursor;
break;
}
- return Qt::ArrowCursor;
+
+ return Qt::ArrowCursor;
}
/**
/**
* 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;