void Context::initButtons() { //Buttons for render mode (CPU | GPU) allButtons[CPU_RENDER].setButton(allocRect(30, 55, 210, 40), allocColor(0xCF, 0xAF, 0xFF, 0xFF), createText(this, "CPU renderer"), true); allButtons[GPU_RENDER].setButton(allocRect(30, 105, 210, 40), allocColor(0xCF, 0xAF, 0xFF, 0xFF), createText(this, "GPU renderer")); allButtons[CPU_RENDER].addLink(GPU_RENDER); allButtons[GPU_RENDER].addLink(CPU_RENDER); //Buttons for type of Accelerated data structure allButtons[BVH].setButton(allocRect(30, 190, 210, 40), allocColor(0xCF, 0xAF, 0xFF, 0xFF), createText(this, " BVH "), true); allButtons[UNIFORM_GRID].setButton(allocRect(30, 240, 210, 40), allocColor(0xCF, 0xAF, 0xFF, 0xFF), createText(this, "Uniform grid")); allButtons[OCTREE].setButton(allocRect(30, 290, 210, 40), allocColor(0xCF, 0xAF, 0xFF, 0xFF), createText(this, " Octree ")); allButtons[LIST].setButton(allocRect(30, 340, 210, 40), allocColor(0xCF, 0xAF, 0xFF, 0xFF), createText(this, " List ")); //Links allButtons[BVH].addLink(UNIFORM_GRID); allButtons[BVH].addLink(OCTREE); allButtons[BVH].addLink(LIST); allButtons[UNIFORM_GRID].addLink(BVH); allButtons[UNIFORM_GRID].addLink(OCTREE); allButtons[UNIFORM_GRID].addLink(LIST); allButtons[OCTREE].addLink(BVH); allButtons[OCTREE].addLink(UNIFORM_GRID); allButtons[OCTREE].addLink(LIST); allButtons[LIST].addLink(BVH); allButtons[LIST].addLink(UNIFORM_GRID); allButtons[LIST].addLink(OCTREE); //Pause button allButtons[PAUSE].setButton(allocRect(750, 10, 40, 40), allocColor(0xCF, 0xAF, 0xFF, 0xFF), createText(this, "||")); }
NSPlate::NSPlate(Mode m) : NSWindow(true, RootWindow(NSdpy, 0)), mode(m) { if (!plateInitialized) { plateInitialized = true; _bgPixel = allocColor(NSdpy, 0x6180,0xa290,0xc300); _bRimPixel = allocColor(NSdpy, 0x8a20,0xe380,0xffff); _dRimPixel = allocColor(NSdpy, 0x30c0,0x5144,0x6180); bgGC = XCreateGC(NSdpy, root(), 0, 0); XSetForeground(NSdpy, bgGC, _bgPixel); bRimGC = XCreateGC(NSdpy, root(), 0, 0); XSetForeground(NSdpy, bRimGC, _bRimPixel); dRimGC = XCreateGC(NSdpy, root(), 0, 0); XSetForeground(NSdpy, dRimGC, _dRimPixel); } selectInput(ExposureMask); background(_bgPixel); }
NSPlate::NSPlate(Mode m) : NSWindow(true, GI_DESKTOP_WINDOW_ID), mode(m) { if (!plateInitialized) { plateInitialized = true; _bgPixel = allocColor( 0x6180,0xa290,0xc300); _bRimPixel = allocColor( 0x8a20,0xe380,0xffff); _dRimPixel = allocColor( 0x30c0,0x5144,0x6180); bgGC = gi_create_gc( root(), 0); gi_set_gc_foreground( bgGC, _bgPixel); bRimGC = gi_create_gc( root(), 0); gi_set_gc_foreground( bRimGC, _bRimPixel); dRimGC = gi_create_gc( root(), 0); gi_set_gc_foreground( dRimGC, _dRimPixel); } selectInput(GI_MASK_EXPOSURE); background(_bgPixel); }
displayStatus::displayStatus(UIObject& parent, int max): UIObject("displayStatus", parent, xmFrameWidgetClass, XmNshadowType, XmSHADOW_ETCHED_IN, XmNmarginWidth, 2, XmNmarginHeight, 2, NULL) { XColor fgclr, bgclr; allocColor("Linen", &fgclr); allocColor("PaleVioletRed3", &bgclr); Pixel fgRet, top, bottom, select; getColors(bgclr.pixel, &fgRet, &top, &bottom, &select); setValues(XmNforeground, fgclr.pixel, XmNbackground, bgclr.pixel, XmNtopShadowColor, top, XmNbottomShadowColor, bottom, XmNborderColor, fgRet, XmNwidth, 400, NULL); maxLength = max; dpyLabel = new UIObject("hello", *this, xmLabelWidgetClass, NULL); dpyLabel->allocColor("Linen", &fgclr); dpyLabel->allocColor("PaleVioletRed3", &bgclr); dpyLabel->getColors(bgclr.pixel, &fgRet, &top, &bottom, &select); dpyLabel->setValues(XmNforeground, fgclr.pixel, XmNbackground, bgclr.pixel, XmNtopShadowColor, top, XmNbottomShadowColor, bottom, XmNselectColor, select, XmNarmColor, select, XmNborderColor, fgRet, NULL); }
void Context::initSubWindows() { leftWindow = std::make_pair(allocRect(10, 10, 250, 580), allocColor(0x6F, 0x6D, 0x70, 0xFF)); rightWindow = std::make_pair(allocRect(290, 90, 500, 500), allocColor(0x6F, 0x6D, 0x70, 0xFF)); }