void StageSettings::updateFromStage() { if (stage_ == 0) return; color_button->setColor(stage_->getBackgroundColor()); slider_->setValue((int) Scene::getMouseSensitivity() - 1); wheel_slider_->setValue((int) Scene::getMouseWheelSensitivity() - 1); eye_distance_slider->setValue((int) (stage_->getEyeDistance() * 10.0)); focal_distance_slider->setValue((int) (stage_->getFocalDistance() * 10.0)); fog_slider->setValue((int) (stage_->getFogIntensity())); fog_box->setChecked(stage_->getFogIntensity() > 0); animation_smoothness->setValue((int) (Scene::getAnimationSmoothness() * 10.0)); //TODO: integration of textures //environment_box->setChecked(stage->getTexture()!=""); or pointer to some texture //setTextureUpDirection_(stage->getTextureUpDirection()); ColorRGBA color = ClippingPlane::getCappingColor(); capping_color_button->setColor(color); capping_transparency->setValue(255 - (int)color.getAlpha()); eyeDistanceChanged(); focalDistanceChanged(); getGLSettings(); downsampling_slider->setSliderPosition(scene_->getDownsamplingFactor()*4.); downsamplingSliderChanged(); }
TYPED_TEST( ColorRGBATest, TestAdd ) { ColorRGBA<TypeParam> c = ColorRGBA<TypeParam>::Red(); c.add( ColorRGBA<TypeParam>::Green() ); EXPECT_EQ( 1.0, c.getRed() ); EXPECT_EQ( 1.0, c.getGreen() ); EXPECT_EQ( 0.0, c.getBlue() ); EXPECT_EQ( 0.0, c.getAlpha() ); }
void GLRenderWindow::renderText(float x, float y, float z, const String& text, const ColorRGBA& color, Size size) { // TEST! return; QFont font; font.setPixelSize(size); font.setBold(true); glDisable(GL_LIGHTING); glColor4ub(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha()); QGLWidget::renderText(x, y, z, text.c_str(), font); glEnable(GL_LIGHTING); }
void GLRenderWindow::renderText(int x, int y, const String& text, const ColorRGBA& color, Size size) { glMatrixMode(GL_PROJECTION); glLoadIdentity(); glViewport(0, 0, m_fmt.getWidth(), m_fmt.getHeight()); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); QFont font; font.setPixelSize(size); font.setBold(true); glDisable(GL_LIGHTING); glColor4ub(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha()); QGLWidget::renderText(x, y, text.c_str(), font); glEnable(GL_LIGHTING); }