void AMDeadTimeButton::updateColorState() { ColorState newState = AMToolButton::None; if (hasDeadTimeSources() || hasICRDataSource()) { // Identify the value used for color state comparison. double newValue = badReferencePoint_; if (countsMode_ == Percent && canDisplayPercentage()) newValue = getPercent(); else if (countsMode_ == Counts && canDisplayCounts()) newValue = getCounts(); else if (countsMode_ == CountRate && canDisplayCountRate()) newValue = getCountRate(); // Identify the new color state. if (newValue < goodReferencePoint_) newState = AMToolButton::Good; else if (newValue >= goodReferencePoint_ && newValue < badReferencePoint_) newState = AMToolButton::Neutral; else newState = AMToolButton::Bad; } setColorState(newState); }
void ObjectFoHandler::mousePressEvent ( QGraphicsSceneMouseEvent */*event*/ ) { if(m_parent!=NULL) { ObjectFoView::EObjectFoState state=m_parent->changeState(); setColorState(state); } else qFatal("ObjectFoHandler is without parent FoObjectView"); }
void PipelineImpl::bind(GlState& state) { glUseProgram(m_glName); if(m_compute) { return; } // Set state setVertexState(state); setInputAssemblerState(state); setTessellationState(state); setViewportState(state); setRasterizerState(state); setDepthStencilState(state); setColorState(state); }
void ObjectFoHandler::setParentObject(ObjectFoView * parent) { //save parent for events like mousepress m_parent=parent; //set parent to NULL is needed in some casees, becouse m_parentGroup->setHandlesChildEvents (true); //didn't work correctly setParentItem(0); //set parent fort graphicsitem setParentItem(m_parent); //set color for rect setColorState(m_parent->state()); //calculate size and position for rect QPointF scale=m_parent->mainView()->scale(); QPoint resizer=QPoint(qreal(EHandlerWidth)/scale.x(), qreal(EHandlerWidth)/scale.y()); QPoint br = parent->rect().topRight().toPoint(); //set rect setRect(QRect(br - resizer ,br + resizer)); }