Commit c4546ced authored by Mike Kremer's avatar Mike Kremer
Browse files

Added ambient component ui element for each color of the light source.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@9136 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 145e814e
......@@ -84,14 +84,17 @@ LightWidget::LightWidget( ACG::SceneGraph::BaseNode* _node, QWidget *parent)
connect(ambientR,SIGNAL(editingFinished()),this,SLOT(ambientChanged()));
connect(ambientG,SIGNAL(editingFinished()),this,SLOT(ambientChanged()));
connect(ambientB,SIGNAL(editingFinished()),this,SLOT(ambientChanged()));
connect(ambientA,SIGNAL(editingFinished()),this,SLOT(ambientChanged()));
connect(diffuseR,SIGNAL(editingFinished()),this,SLOT(diffuseChanged()));
connect(diffuseG,SIGNAL(editingFinished()),this,SLOT(diffuseChanged()));
connect(diffuseB,SIGNAL(editingFinished()),this,SLOT(diffuseChanged()));
connect(diffuseA,SIGNAL(editingFinished()),this,SLOT(diffuseChanged()));
connect(specularR,SIGNAL(editingFinished()),this,SLOT(specularChanged()));
connect(specularG,SIGNAL(editingFinished()),this,SLOT(specularChanged()));
connect(specularB,SIGNAL(editingFinished()),this,SLOT(specularChanged()));
connect(specularA,SIGNAL(editingFinished()),this,SLOT(specularChanged()));
connect(radius,SIGNAL(editingFinished()),this,SLOT(radiusChanged()));
}
......@@ -132,14 +135,17 @@ void LightWidget::showEvent ( QShowEvent * event )
ambientR->setText(QString::number(light_->ambientColor()[0]));
ambientG->setText(QString::number(light_->ambientColor()[1]));
ambientB->setText(QString::number(light_->ambientColor()[2]));
ambientA->setText(QString::number(light_->ambientColor()[3]));
diffuseR->setText(QString::number(light_->diffuseColor()[0]));
diffuseG->setText(QString::number(light_->diffuseColor()[1]));
diffuseB->setText(QString::number(light_->diffuseColor()[2]));
diffuseA->setText(QString::number(light_->diffuseColor()[3]));
specularR->setText(QString::number(light_->specularColor()[0]));
specularG->setText(QString::number(light_->specularColor()[1]));
specularB->setText(QString::number(light_->specularColor()[2]));
specularA->setText(QString::number(light_->specularColor()[3]));
brightness->setSliderPosition((int)(light_->brightness()*100));
......@@ -181,7 +187,7 @@ void LightWidget::ambientChanged() {
light_->ambientColor(ACG::Vec4f(ambientR->text().toDouble(),
ambientG->text().toDouble(),
ambientB->text().toDouble(),
1.0f));
ambientA->text().toDouble()));
updated();
}
......@@ -194,7 +200,7 @@ void LightWidget::diffuseChanged() {
light_->diffuseColor(ACG::Vec4f(diffuseR->text().toDouble(),
diffuseG->text().toDouble(),
diffuseB->text().toDouble(),
1.0f));
diffuseA->text().toDouble()));
updated();
}
......@@ -207,7 +213,7 @@ void LightWidget::specularChanged() {
light_->specularColor(ACG::Vec4f(specularR->text().toDouble(),
specularG->text().toDouble(),
specularB->text().toDouble(),
1.0f));
specularA->text().toDouble()));
updated();
}
......
......@@ -366,6 +366,19 @@
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLineEdit" name="ambientA"/>
</item>
<item row="0" column="3">
<widget class="QLabel" name="label_27">
<property name="text">
<string>A</string>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignHCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="0">
......@@ -416,6 +429,19 @@
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLineEdit" name="diffuseA"/>
</item>
<item row="0" column="3">
<widget class="QLabel" name="label_28">
<property name="text">
<string>A</string>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignHCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="0">
......@@ -466,6 +492,19 @@
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLineEdit" name="specularA"/>
</item>
<item row="0" column="3">
<widget class="QLabel" name="label_29">
<property name="text">
<string>A</string>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignHCenter</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment