surface_render_dockTab.cpp 13.9 KB
Newer Older
Pierre Kraemer's avatar
Pierre Kraemer committed
1 2 3 4 5 6 7 8 9 10 11 12
#include "surface_render_dockTab.h"

#include "surface_render.h"
#include "schnapps.h"
#include "mapHandler.h"

namespace CGoGN
{

namespace SCHNApps
{

Pierre Kraemer's avatar
Pierre Kraemer committed
13
Surface_Render_DockTab::Surface_Render_DockTab(SCHNApps* s, Surface_Render_Plugin* p) :
Pierre Kraemer's avatar
Pierre Kraemer committed
14 15
	m_schnapps(s),
	m_plugin(p),
Pierre Kraemer's avatar
Pierre Kraemer committed
16 17
	m_currentColorDial(0),
	b_updatingUI(false)
18

Pierre Kraemer's avatar
Pierre Kraemer committed
19 20 21 22 23
{
	setupUi(this);

	connect(combo_positionVBO, SIGNAL(currentIndexChanged(int)), this, SLOT(positionVBOChanged(int)));
	connect(combo_normalVBO, SIGNAL(currentIndexChanged(int)), this, SLOT(normalVBOChanged(int)));
Pierre Kraemer's avatar
Pierre Kraemer committed
24
	connect(combo_colorVBO, SIGNAL(currentIndexChanged(int)), this, SLOT(colorVBOChanged(int)));
Pierre Kraemer's avatar
Pierre Kraemer committed
25 26 27 28 29
	connect(check_renderVertices, SIGNAL(toggled(bool)), this, SLOT(renderVerticesChanged(bool)));
	connect(slider_verticesScaleFactor, SIGNAL(valueChanged(int)), this, SLOT(verticesScaleFactorChanged(int)));
	connect(check_renderEdges, SIGNAL(toggled(bool)), this, SLOT(renderEdgesChanged(bool)));
	connect(check_renderFaces, SIGNAL(toggled(bool)), this, SLOT(renderFacesChanged(bool)));
	connect(group_faceShading, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(faceStyleChanged(QAbstractButton*)));
30
	connect(check_renderBoundary, SIGNAL(toggled(bool)), this, SLOT(renderBoundaryChanged(bool)));
31
	connect(check_doubleSided, SIGNAL(toggled(bool)), this, SLOT(renderBackfaceChanged(bool)));
32 33 34 35 36

	m_colorDial  = new QColorDialog(m_diffuseColor,NULL);
	connect(dcolorButton,SIGNAL(clicked()),this,SLOT(diffuseColorClicked()));
	connect(scolorButton,SIGNAL(clicked()),this,SLOT(simpleColorClicked()));
	connect(vcolorButton,SIGNAL(clicked()),this,SLOT(vertexColorClicked()));
37
	connect(bfcolorButton, SIGNAL(clicked()), this, SLOT(backColorClicked()));
38
	connect(bothcolorButton, SIGNAL(clicked()), this, SLOT(bothColorClicked()));
Sylvain Thery's avatar
Sylvain Thery committed
39 40
	connect(m_colorDial,SIGNAL(accepted()),this,SLOT(colorSelected()));

41 42 43 44 45 46
}





Pierre Kraemer's avatar
Pierre Kraemer committed
47
void Surface_Render_DockTab::positionVBOChanged(int index)
48
{
Pierre Kraemer's avatar
Pierre Kraemer committed
49
	if (!b_updatingUI)
50 51 52
	{
		View* view = m_schnapps->getSelectedView();
		MapHandlerGen* map = m_schnapps->getSelectedMap();
53
		if (view && map)
54
		{
Pierre Kraemer's avatar
Pierre Kraemer committed
55
			m_plugin->h_viewParameterSet[view][map].positionVBO = map->getVBO(combo_positionVBO->currentText());
56
			view->updateGL();
57
			m_plugin->pythonRecording("changePositionVBO", "", view->getName(), map->getName(), combo_positionVBO->currentText());
58 59
		}
	}
Pierre Kraemer's avatar
Pierre Kraemer committed
60 61
}

Pierre Kraemer's avatar
Pierre Kraemer committed
62
void Surface_Render_DockTab::normalVBOChanged(int index)
Pierre Kraemer's avatar
Pierre Kraemer committed
63
{
64
	if (!b_updatingUI)
Pierre Kraemer's avatar
Pierre Kraemer committed
65 66 67
	{
		View* view = m_schnapps->getSelectedView();
		MapHandlerGen* map = m_schnapps->getSelectedMap();
68
		if (view && map)
Pierre Kraemer's avatar
Pierre Kraemer committed
69
		{
Pierre Kraemer's avatar
Pierre Kraemer committed
70
			m_plugin->h_viewParameterSet[view][map].normalVBO = map->getVBO(combo_normalVBO->currentText());
Pierre Kraemer's avatar
Pierre Kraemer committed
71
			view->updateGL();
72
			m_plugin->pythonRecording("changeNormalVBO", "", view->getName(), map->getName(), combo_normalVBO->currentText());
Pierre Kraemer's avatar
Pierre Kraemer committed
73 74 75 76
		}
	}
}

Pierre Kraemer's avatar
Pierre Kraemer committed
77
void Surface_Render_DockTab::colorVBOChanged(int index)
Pierre Kraemer's avatar
Pierre Kraemer committed
78
{
79
	if (!b_updatingUI)
Pierre Kraemer's avatar
Pierre Kraemer committed
80 81 82
	{
		View* view = m_schnapps->getSelectedView();
		MapHandlerGen* map = m_schnapps->getSelectedMap();
83
		if (view && map)
Pierre Kraemer's avatar
Pierre Kraemer committed
84
		{
Pierre Kraemer's avatar
Pierre Kraemer committed
85
			m_plugin->h_viewParameterSet[view][map].colorVBO = map->getVBO(combo_colorVBO->currentText());
Pierre Kraemer's avatar
Pierre Kraemer committed
86
			view->updateGL();
87
			m_plugin->pythonRecording("changeColorVBO", "", view->getName(), map->getName(), combo_colorVBO->currentText());
Pierre Kraemer's avatar
Pierre Kraemer committed
88 89 90 91
		}
	}
}

Pierre Kraemer's avatar
Pierre Kraemer committed
92
void Surface_Render_DockTab::renderVerticesChanged(bool b)
Pierre Kraemer's avatar
Pierre Kraemer committed
93
{
94
	if (!b_updatingUI)
Pierre Kraemer's avatar
Pierre Kraemer committed
95 96 97
	{
		View* view = m_schnapps->getSelectedView();
		MapHandlerGen* map = m_schnapps->getSelectedMap();
98
		if (view && map)
Pierre Kraemer's avatar
Pierre Kraemer committed
99 100 101
		{
			m_plugin->h_viewParameterSet[view][map].renderVertices = b;
			view->updateGL();
Sylvain Thery's avatar
Sylvain Thery committed
102
			m_plugin->pythonRecording("changeRenderVertices", "", view->getName(), map->getName(), b);
Pierre Kraemer's avatar
Pierre Kraemer committed
103 104 105 106
		}
	}
}

Pierre Kraemer's avatar
Pierre Kraemer committed
107
void Surface_Render_DockTab::verticesScaleFactorChanged(int i)
Pierre Kraemer's avatar
Pierre Kraemer committed
108
{
109
	if (!b_updatingUI)
Pierre Kraemer's avatar
Pierre Kraemer committed
110 111 112
	{
		View* view = m_schnapps->getSelectedView();
		MapHandlerGen* map = m_schnapps->getSelectedMap();
113
		if (view && map)
Pierre Kraemer's avatar
Pierre Kraemer committed
114 115 116
		{
			m_plugin->h_viewParameterSet[view][map].verticesScaleFactor = i / 50.0;
			view->updateGL();
Sylvain Thery's avatar
Sylvain Thery committed
117
			m_plugin->pythonRecording("changeVerticesScaleFactor", "", view->getName(), map->getName(), i / 50.0);
Pierre Kraemer's avatar
Pierre Kraemer committed
118 119 120 121
		}
	}
}

Pierre Kraemer's avatar
Pierre Kraemer committed
122
void Surface_Render_DockTab::renderEdgesChanged(bool b)
Pierre Kraemer's avatar
Pierre Kraemer committed
123
{
124
	if (!b_updatingUI)
Pierre Kraemer's avatar
Pierre Kraemer committed
125 126 127
	{
		View* view = m_schnapps->getSelectedView();
		MapHandlerGen* map = m_schnapps->getSelectedMap();
128
		if (view && map)
Pierre Kraemer's avatar
Pierre Kraemer committed
129 130 131
		{
			m_plugin->h_viewParameterSet[view][map].renderEdges = b;
			view->updateGL();
Sylvain Thery's avatar
Sylvain Thery committed
132
			m_plugin->pythonRecording("changeRenderEdges", "", view->getName(), map->getName(), b);
Pierre Kraemer's avatar
Pierre Kraemer committed
133 134 135 136
		}
	}
}

Pierre Kraemer's avatar
Pierre Kraemer committed
137
void Surface_Render_DockTab::renderFacesChanged(bool b)
Pierre Kraemer's avatar
Pierre Kraemer committed
138
{
139
	if (!b_updatingUI)
Pierre Kraemer's avatar
Pierre Kraemer committed
140 141 142
	{
		View* view = m_schnapps->getSelectedView();
		MapHandlerGen* map = m_schnapps->getSelectedMap();
143
		if (view && map)
Pierre Kraemer's avatar
Pierre Kraemer committed
144 145 146
		{
			m_plugin->h_viewParameterSet[view][map].renderFaces = b;
			view->updateGL();
Sylvain Thery's avatar
Sylvain Thery committed
147
			m_plugin->pythonRecording("changeRenderFaces", "", view->getName(), map->getName(), b);
Pierre Kraemer's avatar
Pierre Kraemer committed
148 149 150 151
		}
	}
}

Pierre Kraemer's avatar
Pierre Kraemer committed
152
void Surface_Render_DockTab::faceStyleChanged(QAbstractButton* b)
Pierre Kraemer's avatar
Pierre Kraemer committed
153
{
154
	if (!b_updatingUI)
Pierre Kraemer's avatar
Pierre Kraemer committed
155 156 157
	{
		View* view = m_schnapps->getSelectedView();
		MapHandlerGen* map = m_schnapps->getSelectedMap();
158
		if (view && map)
Pierre Kraemer's avatar
Pierre Kraemer committed
159
		{
160
			if (radio_flatShading->isChecked())
Pierre Kraemer's avatar
Pierre Kraemer committed
161
				m_plugin->h_viewParameterSet[view][map].faceStyle = MapParameters::FLAT;
162
			else if (radio_phongShading->isChecked())
Pierre Kraemer's avatar
Pierre Kraemer committed
163 164
				m_plugin->h_viewParameterSet[view][map].faceStyle = MapParameters::PHONG;
			view->updateGL();
Sylvain Thery's avatar
Sylvain Thery committed
165
			m_plugin->pythonRecording("changeFacesStyle", "", view->getName(), map->getName(), m_plugin->h_viewParameterSet[view][map].faceStyle);
Pierre Kraemer's avatar
Pierre Kraemer committed
166 167 168 169
		}
	}
}

170 171
void Surface_Render_DockTab::renderBoundaryChanged(bool b)
{
172
	if (!b_updatingUI)
173 174 175
	{
		View* view = m_schnapps->getSelectedView();
		MapHandlerGen* map = m_schnapps->getSelectedMap();
176
		if (view && map)
177 178 179
		{
			m_plugin->h_viewParameterSet[view][map].renderBoundary = b;
			view->updateGL();
Sylvain Thery's avatar
Sylvain Thery committed
180
			m_plugin->pythonRecording("changeRenderBoundary", "", view->getName(), map->getName(), b);
181 182 183 184
		}
	}
}

Pierre Kraemer's avatar
Pierre Kraemer committed
185 186


187 188 189 190 191 192 193 194 195 196 197 198 199 200 201
void Surface_Render_DockTab::renderBackfaceChanged(bool b)
{
	if (!b_updatingUI)
	{
		View* view = m_schnapps->getSelectedView();
		MapHandlerGen* map = m_schnapps->getSelectedMap();
		if (view && map)
		{
			m_plugin->h_viewParameterSet[view][map].renderBackfaces = b;
			view->updateGL();
			m_plugin->pythonRecording("changeRenderBackfaces", "", view->getName(), map->getName(), b);
		}
	}
}

Pierre Kraemer's avatar
Pierre Kraemer committed
202 203
void Surface_Render_DockTab::diffuseColorClicked()
{
Sylvain Thery's avatar
Sylvain Thery committed
204
	m_currentColorDial = 1;
Pierre Kraemer's avatar
Pierre Kraemer committed
205 206 207 208 209 210
	m_colorDial->show();
	m_colorDial->setCurrentColor(m_diffuseColor);
}

void Surface_Render_DockTab::simpleColorClicked()
{
Sylvain Thery's avatar
Sylvain Thery committed
211
	m_currentColorDial = 2;
Pierre Kraemer's avatar
Pierre Kraemer committed
212 213 214 215 216 217
	m_colorDial->show();
	m_colorDial->setCurrentColor(m_simpleColor);
}

void Surface_Render_DockTab::vertexColorClicked()
{
Sylvain Thery's avatar
Sylvain Thery committed
218
	m_currentColorDial = 3;
Pierre Kraemer's avatar
Pierre Kraemer committed
219 220 221 222
	m_colorDial->show();
	m_colorDial->setCurrentColor(m_vertexColor);
}

223 224 225
void Surface_Render_DockTab::backColorClicked()
{
	m_currentColorDial = 4;
Sylvain Thery's avatar
Sylvain Thery committed
226 227
	m_colorDial->show();
	m_colorDial->setCurrentColor(m_backColor);
228 229
}

230 231 232 233 234 235 236 237
void Surface_Render_DockTab::bothColorClicked()
{
	m_currentColorDial = 5;
	m_colorDial->show();
	m_colorDial->setCurrentColor(m_diffuseColor);

}

Pierre Kraemer's avatar
Pierre Kraemer committed
238

Sylvain Thery's avatar
Sylvain Thery committed
239
void Surface_Render_DockTab::colorSelected()
Pierre Kraemer's avatar
Pierre Kraemer committed
240
{
Sylvain Thery's avatar
Sylvain Thery committed
241
	QColor col = m_colorDial->currentColor();
Pierre Kraemer's avatar
Pierre Kraemer committed
242 243 244 245
	if (m_currentColorDial == 1)
	{
		m_diffuseColor = col;
		dcolorButton->setStyleSheet("QPushButton { background-color:" + col.name() + "}");
246
		bothcolorButton->setStyleSheet("QPushButton { background-color:" + col.name() + "}");
Pierre Kraemer's avatar
Pierre Kraemer committed
247 248 249 250 251 252 253 254 255

		Geom::Vec4f rgbCol(1.0/255.0*m_diffuseColor.red(), 1.0/255.0*m_diffuseColor.green(),1.0/255.0*m_diffuseColor.blue(),0.0f);

		View* view = m_schnapps->getSelectedView();
		MapHandlerGen* map = m_schnapps->getSelectedMap();
		if (view && map)
		{
			m_plugin->h_viewParameterSet[view][map].diffuseColor = rgbCol;
			view->updateGL();
256
			m_plugin->pythonRecording("changeFaceColor", "", view->getName(), map->getName(), rgbCol[0], rgbCol[1], rgbCol[2]);
Pierre Kraemer's avatar
Pierre Kraemer committed
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272
		}
	}

	if (m_currentColorDial == 2)
	{
		m_simpleColor = col;
		scolorButton->setStyleSheet("QPushButton { background-color:" + col.name() + "}");

		Geom::Vec4f rgbCol(1.0/255.0*m_simpleColor.red(), 1.0/255.0*m_simpleColor.green(),1.0/255.0*m_simpleColor.blue(),0.0f);

		View* view = m_schnapps->getSelectedView();
		MapHandlerGen* map = m_schnapps->getSelectedMap();
		if (view && map)
		{
			m_plugin->h_viewParameterSet[view][map].simpleColor = rgbCol;
			view->updateGL();
273
			m_plugin->pythonRecording("changeEdgeColor", "", view->getName(), map->getName(), rgbCol[0], rgbCol[1], rgbCol[2]);
Pierre Kraemer's avatar
Pierre Kraemer committed
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289
		}
	}

	if (m_currentColorDial == 3)
	{
		m_vertexColor = col;
		vcolorButton->setStyleSheet("QPushButton { background-color:" + col.name() + "}");

		Geom::Vec4f rgbCol(1.0/255.0*m_vertexColor.red(), 1.0/255.0*m_vertexColor.green(),1.0/255.0*m_vertexColor.blue(),0.0f);

		View* view = m_schnapps->getSelectedView();
		MapHandlerGen* map = m_schnapps->getSelectedMap();
		if (view && map)
		{
			m_plugin->h_viewParameterSet[view][map].vertexColor = rgbCol;
			view->updateGL();
290
			m_plugin->pythonRecording("changeVertexColor", "", view->getName(), map->getName(), rgbCol[0], rgbCol[1], rgbCol[2]);
Pierre Kraemer's avatar
Pierre Kraemer committed
291 292
		}
	}
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309

	if (m_currentColorDial == 4)
	{
		m_backColor = col;
		bfcolorButton->setStyleSheet("QPushButton { background-color:" + col.name() + "}");

		Geom::Vec4f rgbCol(1.0 / 255.0*m_backColor.red(), 1.0 / 255.0*m_backColor.green(), 1.0 / 255.0*m_backColor.blue(), 0.0f);

		View* view = m_schnapps->getSelectedView();
		MapHandlerGen* map = m_schnapps->getSelectedMap();
		if (view && map)
		{
			m_plugin->h_viewParameterSet[view][map].backColor = rgbCol;
			view->updateGL();
			m_plugin->pythonRecording("changeBackColor", "", view->getName(), map->getName(), rgbCol[0], rgbCol[1], rgbCol[2]);
		}
	}
310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333

	if (m_currentColorDial == 5)
	{
		m_backColor = col;
		bfcolorButton->setStyleSheet("QPushButton { background-color:" + col.name() + "}");

		m_diffuseColor = col;
		dcolorButton->setStyleSheet("QPushButton { background-color:" + col.name() + "}");

		bothcolorButton->setStyleSheet("QPushButton { background-color:" + col.name() + "}");

		Geom::Vec4f rgbCol(1.0 / 255.0*m_backColor.red(), 1.0 / 255.0*m_backColor.green(), 1.0 / 255.0*m_backColor.blue(), 0.0f);

		View* view = m_schnapps->getSelectedView();
		MapHandlerGen* map = m_schnapps->getSelectedMap();
		if (view && map)
		{
			m_plugin->h_viewParameterSet[view][map].backColor = rgbCol;
			m_plugin->h_viewParameterSet[view][map].diffuseColor = rgbCol;
			view->updateGL();
			m_plugin->pythonRecording("changeBackColor", "", view->getName(), map->getName(), rgbCol[0], rgbCol[1], rgbCol[2]);
			m_plugin->pythonRecording("changeFaceColor", "", view->getName(), map->getName(), rgbCol[0], rgbCol[1], rgbCol[2]);
		}
	}
Pierre Kraemer's avatar
Pierre Kraemer committed
334 335 336 337 338 339
}





Pierre Kraemer's avatar
Pierre Kraemer committed
340
void Surface_Render_DockTab::addPositionVBO(QString name)
Pierre Kraemer's avatar
Pierre Kraemer committed
341 342 343 344 345 346
{
	b_updatingUI = true;
	combo_positionVBO->addItem(name);
	b_updatingUI = false;
}

Pierre Kraemer's avatar
Pierre Kraemer committed
347
void Surface_Render_DockTab::removePositionVBO(QString name)
Pierre Kraemer's avatar
Pierre Kraemer committed
348 349 350 351
{
	b_updatingUI = true;
	int curIndex = combo_positionVBO->currentIndex();
	int index = combo_positionVBO->findText(name, Qt::MatchExactly);
352
	if (curIndex == index)
Pierre Kraemer's avatar
Pierre Kraemer committed
353 354 355 356 357
		combo_positionVBO->setCurrentIndex(0);
	combo_positionVBO->removeItem(index);
	b_updatingUI = false;
}

Pierre Kraemer's avatar
Pierre Kraemer committed
358
void Surface_Render_DockTab::addNormalVBO(QString name)
Pierre Kraemer's avatar
Pierre Kraemer committed
359 360 361 362 363 364
{
	b_updatingUI = true;
	combo_normalVBO->addItem(name);
	b_updatingUI = false;
}

Pierre Kraemer's avatar
Pierre Kraemer committed
365
void Surface_Render_DockTab::removeNormalVBO(QString name)
Pierre Kraemer's avatar
Pierre Kraemer committed
366 367 368 369
{
	b_updatingUI = true;
	int curIndex = combo_normalVBO->currentIndex();
	int index = combo_normalVBO->findText(name, Qt::MatchExactly);
370
	if (curIndex == index)
Pierre Kraemer's avatar
Pierre Kraemer committed
371 372 373 374 375
		combo_normalVBO->setCurrentIndex(0);
	combo_normalVBO->removeItem(index);
	b_updatingUI = false;
}

Pierre Kraemer's avatar
Pierre Kraemer committed
376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393
void Surface_Render_DockTab::addColorVBO(QString name)
{
	b_updatingUI = true;
	combo_colorVBO->addItem(name);
	b_updatingUI = false;
}

void Surface_Render_DockTab::removeColorVBO(QString name)
{
	b_updatingUI = true;
	int curIndex = combo_colorVBO->currentIndex();
	int index = combo_colorVBO->findText(name, Qt::MatchExactly);
	if (curIndex == index)
		combo_colorVBO->setCurrentIndex(0);
	combo_colorVBO->removeItem(index);
	b_updatingUI = false;
}

Pierre Kraemer's avatar
Pierre Kraemer committed
394
void Surface_Render_DockTab::updateMapParameters()
Pierre Kraemer's avatar
Pierre Kraemer committed
395 396 397 398 399
{
	b_updatingUI = true;

	combo_positionVBO->clear();
	combo_positionVBO->addItem("- select VBO -");
Pierre Kraemer's avatar
Pierre Kraemer committed
400 401

	combo_normalVBO->clear();
Pierre Kraemer's avatar
Pierre Kraemer committed
402 403
	combo_normalVBO->addItem("- select VBO -");

Pierre Kraemer's avatar
Pierre Kraemer committed
404 405 406
	combo_colorVBO->clear();
	combo_colorVBO->addItem("- select VBO -");

Pierre Kraemer's avatar
Pierre Kraemer committed
407 408 409
	View* view = m_schnapps->getSelectedView();
	MapHandlerGen* map = m_schnapps->getSelectedMap();

410
	if (view && map)
Pierre Kraemer's avatar
Pierre Kraemer committed
411 412 413 414 415 416
	{
		const MapParameters& p = m_plugin->h_viewParameterSet[view][map];

		unsigned int i = 1;
		foreach(Utils::VBO* vbo, map->getVBOSet().values())
		{
417
			if (vbo->dataSize() == 3)
Pierre Kraemer's avatar
Pierre Kraemer committed
418 419
			{
				combo_positionVBO->addItem(QString::fromStdString(vbo->name()));
420
				if (vbo == p.positionVBO)
Pierre Kraemer's avatar
Pierre Kraemer committed
421 422 423
					combo_positionVBO->setCurrentIndex(i);

				combo_normalVBO->addItem(QString::fromStdString(vbo->name()));
424
				if (vbo == p.normalVBO)
Pierre Kraemer's avatar
Pierre Kraemer committed
425 426
					combo_normalVBO->setCurrentIndex(i);

Pierre Kraemer's avatar
Pierre Kraemer committed
427 428 429 430
				combo_colorVBO->addItem(QString::fromStdString(vbo->name()));
				if (vbo == p.colorVBO)
					combo_colorVBO->setCurrentIndex(i);

Pierre Kraemer's avatar
Pierre Kraemer committed
431 432 433 434 435 436 437 438 439 440
				++i;
			}
		}

		check_renderVertices->setChecked(p.renderVertices);
		slider_verticesScaleFactor->setSliderPosition(p.verticesScaleFactor * 50.0);
		check_renderEdges->setChecked(p.renderEdges);
		check_renderFaces->setChecked(p.renderFaces);
		radio_flatShading->setChecked(p.faceStyle == MapParameters::FLAT);
		radio_phongShading->setChecked(p.faceStyle == MapParameters::PHONG);
441

442 443
		m_diffuseColor = QColor(255 * p.diffuseColor[0], 255 * p.diffuseColor[1], 255 * p.diffuseColor[2]);
		dcolorButton->setStyleSheet("QPushButton { background-color:" + m_diffuseColor.name() + " }");
444
		bothcolorButton->setStyleSheet("QPushButton { background-color:" + m_diffuseColor.name() + "}");
445

446 447
		m_simpleColor = QColor(255 * p.simpleColor[0], 255 * p.simpleColor[1], 255 * p.simpleColor[2]);
		scolorButton->setStyleSheet("QPushButton { background-color:" + m_simpleColor.name() + " }");
448

449 450
		m_vertexColor = QColor(255 * p.vertexColor[0], 255 * p.vertexColor[1], 255 * p.vertexColor[2]);
		vcolorButton->setStyleSheet("QPushButton { background-color:" + m_vertexColor.name() + " }");
451 452 453

		m_backColor = QColor(255 * p.backColor[0], 255 * p.backColor[1], 255 * p.backColor[2]);
		bfcolorButton->setStyleSheet("QPushButton { background-color:" + m_backColor.name() + " }");
Pierre Kraemer's avatar
Pierre Kraemer committed
454 455 456 457 458 459 460 461
	}

	b_updatingUI = false;
}

} // namespace SCHNApps

} // namespace CGoGN