示例#1
0
void LabViewModule::parseGlobalcolor(QXmlStreamReader *xml)
{
    while(!(xml->tokenType() == QXmlStreamReader::EndElement && xml->name() == "globalcolor"))
    {
        if(xml->tokenType() == QXmlStreamReader::StartElement)
        {
            if(xml->name() == "red")
            {
                xml->readNext();
                currentColor()->setRed( xml->text().toString().toInt() );
            }
            if(xml->name() == "green")
            {
                xml->readNext();
                currentColor()->setGreen( xml->text().toString().toInt() );
            }
            if(xml->name() == "blu")
            {
                xml->readNext();
                currentColor()->setBlue( xml->text().toString().toInt() );
            }
            if(xml->name() == "intensity")
            {
                xml->readNext();
                currentColor()->setAlpha( xml->text().toString().toInt() );
            }
        }
        xml->readNext();
    }
    setGlobalColor(*currentColor());
    //sendGlobalColor(); // we update firmware data
}
示例#2
0
//--------------------------------------------------------------
void ofxFatLine::setFromPolyline(ofPolyline & poly){
//	ofxFatLine();
	setGlobalColor(ofGetStyle().color);
	setGlobalWidth(ofGetStyle().lineWidth);
	if (!poly.getVertices().empty()){
		addVertices(poly.getVertices());
	for (int i = 0; i <getVertices().size(); i++) {
		addColor(globalColor);
		addWeight(globalWidth);
	}
	update();
	//*/
	}		
}
void StelQGLRenderer::drawWindow(StelViewportEffect* const effect)
{
	// At this point, FBOs have been released (if using FBOs), so we're drawing 
	// directly to the screen. The StelViewportEffect::drawToViewport call 
	// actually draws puts the rendered result onto the viewport.
	invariant();

	//Warn about any GL errors.
	checkGLErrors("drawWindow() start");
	
	//Effects are ignored when FBO is not supported.
	//That might be changed for some GPUs, but it might not be worth the effort.
	
	viewport.prepareToDrawViewport();

	if(NULL == effect)
	{
		// If using FBO, we still need to put it on the screen.
		if(viewport.useFBO())
		{
			StelTextureNew* screenTexture = getViewportTexture();
			const QSize size = screenTexture->getDimensions();

			glDisable(GL_BLEND);
			setGlobalColor(Vec4f(1.0f, 1.0f, 1.0f, 1.0f));
			screenTexture->bind();
			drawTexturedRect(0, 0, size.width(), size.height());
			delete screenTexture;
		}
		// If not using FBO, the result is already drawn to the screen.
	}
	else
	{
		effect->drawToViewport(this);
	}

	viewport.disablePainting();

	checkGLErrors("drawWindow() end");
	invariant();
}
示例#4
0
void LabViewModule::initAll()
{
    _mediaPlayer = NULL;
    setGlobalColor( QColor( 0, 0, 0 ) );
    initFaceClass();
}
示例#5
0
//--------------------------------------------------------------
void ofxFatLine::setGlobalColor(ofColor col){
	setGlobalColor(ofFloatColor(col.r, col.g, col.b, col.a));
}