int caCamera::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; #ifndef QT_NO_PROPERTIES if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QString*>(_v) = getPV_Data(); break; case 1: *reinterpret_cast< QString*>(_v) = getPV_Width(); break; case 2: *reinterpret_cast< QString*>(_v) = getPV_Height(); break; case 3: *reinterpret_cast< QString*>(_v) = getPV_Code(); break; case 4: *reinterpret_cast< QString*>(_v) = getPV_BPP(); break; case 5: *reinterpret_cast< zoom*>(_v) = getZoom(); break; case 6: *reinterpret_cast< colormap*>(_v) = getColormap(); break; case 7: *reinterpret_cast< bool*>(_v) = getInitialAutomatic(); break; case 8: *reinterpret_cast< QString*>(_v) = getMinLevel(); break; case 9: *reinterpret_cast< QString*>(_v) = getMaxLevel(); break; case 10: *reinterpret_cast< QString*>(_v) = getDataProcChannels(); break; } _id -= 11; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setPV_Data(*reinterpret_cast< QString*>(_v)); break; case 1: setPV_Width(*reinterpret_cast< QString*>(_v)); break; case 2: setPV_Height(*reinterpret_cast< QString*>(_v)); break; case 3: setPV_Code(*reinterpret_cast< QString*>(_v)); break; case 4: setPV_BPP(*reinterpret_cast< QString*>(_v)); break; case 5: setZoom(*reinterpret_cast< zoom*>(_v)); break; case 6: setColormap(*reinterpret_cast< colormap*>(_v)); break; case 7: setInitialAutomatic(*reinterpret_cast< bool*>(_v)); break; case 8: setMinLevel(*reinterpret_cast< QString*>(_v)); break; case 9: setMaxLevel(*reinterpret_cast< QString*>(_v)); break; case 10: setDataProcChannels(*reinterpret_cast< QString*>(_v)); break; } _id -= 11; } else if (_c == QMetaObject::ResetProperty) { _id -= 11; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 11; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 11; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 11; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 11; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 11; } #endif // QT_NO_PROPERTIES return _id; }
QColor ColormapFunctions::getColor( int colormapID, float value, float min, float max, float lowerThreshold, float upperThreshold, float alpha ) { ColormapBase cmap = getColormap( colormapID ); float value1 = value; if ( value < lowerThreshold || value > upperThreshold ) { value1 = 0; } float value2 = ( value1 - min ) / ( max - min ); //mapped so that s_min = 0, s_max=1 if ( value1 > 0 ) { QColor c = cmap.getColor( qMax( 0.0f, qMin( 1.0f, value2 ) ) ); c.setAlphaF( alpha ); return c; } else { return QColor( 0, 0, 0, 0 ); } }
void OGLwin_Open_Window(int x, int y, int width, int height, char *name, WINTYPE t, Window parent_win) { XSetWindowAttributes swa; XEvent event; unsigned long attr_mask; Window parent; Window root_win; if (!Dsp) { if (global_display != NULL) { Dsp = global_display; } else { Dsp = XOpenDisplay(0); } } if (getenv("OGLWIN_USE12")) { attributes[RGBA_SINGLE] = rgba12_att; attributes[RGBA_DOUBLE] = rgba12_datt; } Vi = glXChooseVisual(Dsp, DefaultScreen(Dsp), attributes[t]); Cmap = getColormap(Dsp, Vi, t); swa.border_pixel = 0; swa.colormap = Cmap; swa.event_mask = ExposureMask | StructureNotifyMask | VisibilityChangeMask | PointerMotionMask | ButtonPressMask | ButtonReleaseMask | KeyPressMask | KeyReleaseMask; swa.override_redirect = OGLwin_override_redirect; attr_mask = CWBorderPixel | CWColormap | CWEventMask | CWOverrideRedirect; parent = parent_win; root_win = RootWindow(Dsp, Vi->screen); if (!parent) parent = root_win; if (parent_border) { parent = XCreateSimpleWindow(Dsp, parent, x, y, width, height, 0, 0, 0); XSelectInput(Dsp, parent, StructureNotifyMask); x = y = parent_border; width -= parent_border; height -= parent_border; } XWindow = XCreateWindow(Dsp, parent, x, y, width, height, 0, Vi->depth, InputOutput, Vi->visual, attr_mask, &swa); if (parent_win == root_win) { Window top_win = (parent_border ? parent : XWindow); /* * fix size/position/aspect of new swWindow */ { XSizeHints *size_hints; size_hints = XAllocSizeHints(); size_hints->flags = USSize | PSize | USPosition | PPosition; XSetWMNormalHints(Dsp, top_win, size_hints); XFree(size_hints); } XSetWMColormapWindows(Dsp, XWindow, &XWindow, 1); XStoreName(Dsp, top_win, name); XMapSubwindows(Dsp, top_win); XMapWindow(Dsp, top_win); XIfEvent(Dsp, &event, WaitForMapNotify, (char *) top_win); } else { XMapWindow(Dsp, XWindow); XIfEvent(Dsp, &event, WaitForMapNotify, (char *) XWindow); } Cxt = glXCreateContext(Dsp, Vi, 0, direct_context); //SetWin(); fontBase = -1; }