Developer Documentation
ColorPlugin.cc
1 /*===========================================================================*\
2 * *
3 * OpenFlipper *
4  * Copyright (c) 2001-2015, RWTH-Aachen University *
5  * Department of Computer Graphics and Multimedia *
6  * All rights reserved. *
7  * www.openflipper.org *
8  * *
9  *---------------------------------------------------------------------------*
10  * This file is part of OpenFlipper. *
11  *---------------------------------------------------------------------------*
12  * *
13  * Redistribution and use in source and binary forms, with or without *
14  * modification, are permitted provided that the following conditions *
15  * are met: *
16  * *
17  * 1. Redistributions of source code must retain the above copyright notice, *
18  * this list of conditions and the following disclaimer. *
19  * *
20  * 2. Redistributions in binary form must reproduce the above copyright *
21  * notice, this list of conditions and the following disclaimer in the *
22  * documentation and/or other materials provided with the distribution. *
23  * *
24  * 3. Neither the name of the copyright holder nor the names of its *
25  * contributors may be used to endorse or promote products derived from *
26  * this software without specific prior written permission. *
27  * *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
30  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
31  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
32  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
33  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
34  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
35  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
36  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
37  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
38  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
39 * *
40 \*===========================================================================*/
41 
42 #include "ColorPlugin.hh"
43 
44 
47 #include <OpenFlipper/BasePlugin/WhatsThisGenerator.hh>
48 
49 #include <ACG/Scenegraph/MaterialNode.hh>
50 
51 //-----------------------------------------------------------------------------
52 
56 ColorPlugin::ColorPlugin() : optionsWidget_(0)
57 {
58 
59  //set default values for colors
60 
62  backgroundColorPaper_ = OpenMesh::Vec4f(1.00f, 1.00f, 1.00f, 1.0f);
63  backgroundColorPresentation_ = OpenMesh::Vec4f(0.0f, 0.188f, 0.062f, 1.0f);
65  baseColorPaper_ = OpenMesh::Vec4f(0.00f, 0.00f, 0.00f, 1.0f);
66  baseColorPresentation_ = OpenMesh::Vec4f(0.88f, 0.88f, 0.188f, 1.0f);
68  materialColorPaper_ = OpenMesh::Vec4f(0.12f, 0.76f, 0.62f, 1.0f);
69  materialColorPresentation_ = OpenMesh::Vec4f(0.941f, 0.439f, 0.31f, 1.0f);
70 
71  lineWidthDefault_ = 1.0;
72  lineWidthPaper_ = 2.0;
74 
75 }
76 
77 
78 //-----------------------------------------------------------------------------
79 
84 {
85  // =============================================================================
86  // Add a Menu for color selection
87  // =============================================================================
88  QMenu *colorMenu = new QMenu(tr("&Color schemes"));
89 
90  colorMenu->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"format-stroke-color.png"));
91  emit addMenubarAction(colorMenu->menuAction(), VIEWMENU );
92 
93  // =============================================================================
94  // Add Menu entries
95  // =============================================================================
96  WhatsThisGenerator whatsThis("Color");
97 
98  QAction* AC_set_Default_color = new QAction(tr("&Default colors"), this);
99  AC_set_Default_color->setStatusTip(tr("Set Default Colors"));
100  AC_set_Default_color->setWhatsThis(tr("Set colors to default colors. ")+whatsThis.generateLink());
101  AC_set_Default_color->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"color-default.png"));
102  connect(AC_set_Default_color, SIGNAL(triggered()), this, SLOT(setDefaultColor()));
103  colorMenu->addAction(AC_set_Default_color);
104 
105  QAction* AC_set_Presentation_color = new QAction(tr("&Presentation colors"), this);
106  AC_set_Presentation_color->setStatusTip(tr("Set Presentation Colors"));
107  AC_set_Presentation_color->setWhatsThis(tr("Set colors to presentation colors. ")+whatsThis.generateLink());
108  AC_set_Presentation_color->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"color-powerpoint.png"));
109  connect(AC_set_Presentation_color, SIGNAL(triggered()), this, SLOT(setPresentationColor()));
110  colorMenu->addAction(AC_set_Presentation_color);
111 
112  QAction* AC_set_Paper_color = new QAction(tr("&Paper colors"), this);
113  AC_set_Paper_color->setStatusTip(tr("Set Paper Colors"));
114  AC_set_Paper_color->setWhatsThis(tr("Set colors to colors for papers. ")+whatsThis.generateLink());
115  AC_set_Paper_color->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"color-paper.png"));
116  connect(AC_set_Paper_color, SIGNAL(triggered()), this, SLOT(setPaperColor()));
117  colorMenu->addAction(AC_set_Paper_color);
118 
119  // =============================================================================
120  // Create Tool bar with same contents
121  // =============================================================================
122 
123  QToolBar* toolbar = new QToolBar(tr("Color Toolbar"));
124  toolbar->addAction(AC_set_Default_color);
125  toolbar->addAction(AC_set_Presentation_color);
126  toolbar->addAction(AC_set_Paper_color);
127  emit addToolbar( toolbar );
128 
129 }
130 
131 
132 //-----------------------------------------------------------------------------
133 
138 
139  // =============================================================================
140  // Give user feedback
141  // =============================================================================
142  emit scriptInfo( "setDefaultColor()" );
143  emit showStatusMessage( tr("Set to default Colors"), 4000 );
144 
145  // =============================================================================
146  // Define the new colors
147  // =============================================================================
148  OpenMesh::Vec4f ambient_color,
149  diffuse_color,
150  specular_color;
151 
152  ambient_color = 0.2f * materialColorDefault_;
153  diffuse_color = 0.6f * materialColorDefault_;
154  specular_color = 0.8f * materialColorDefault_;
155  ambient_color[3] = 1.0f;
156  diffuse_color[3] = 1.0f;
157  specular_color[3] = 1.0f;
158 
159  // Set background color
161 
162  // =============================================================================
163  // Apply to all objects
164  // =============================================================================
166  MaterialNode* mat = o_it->materialNode();
168  mat->set_ambient_color(ambient_color);
169  mat->set_diffuse_color(diffuse_color);
170  mat->set_specular_color(specular_color);
172  }
173 
174  emit updateView();
175 }
176 
177 
178 //-----------------------------------------------------------------------------
179 
184 
185  // =============================================================================
186  // Give user feedback
187  // =============================================================================
188  emit scriptInfo( "setPresentationColor()" );
189  emit showStatusMessage( tr("Set to Presentation Colors"), 4000 );
190 
191  // =============================================================================
192  // Define the new colors
193  // =============================================================================
194  OpenMesh::Vec4f ambient_color,
195  diffuse_color,
196  specular_color;
197 
198  ambient_color = 0.2f * materialColorPresentation_;
199  diffuse_color = 0.6f * materialColorPresentation_;
200  specular_color = 0.8f * materialColorPresentation_;
201  ambient_color[3] = 1.0f;
202  diffuse_color[3] = 1.0f;
203  specular_color[3] = 1.0f;
204 
205  // Set background color
207 
208  // =============================================================================
209  // Apply to all objects
210  // =============================================================================
212  MaterialNode* mat = o_it->materialNode();
214  mat->set_ambient_color(ambient_color);
215  mat->set_diffuse_color(diffuse_color);
216  mat->set_specular_color(specular_color);
218  }
219 
220  emit updateView();
221 }
222 
223 
224 //-----------------------------------------------------------------------------
225 
230 
231  // =============================================================================
232  // Give user feedback
233  // =============================================================================
234  emit scriptInfo( "setPaperColor()" );
235  emit showStatusMessage( tr("Set to Paper Colors"), 4000 );
236 
237  // =============================================================================
238  // Define the new colors
239  // =============================================================================
240  OpenMesh::Vec4f ambient_color,
241  diffuse_color,
242  specular_color;
243 
244  ambient_color = 0.2f * materialColorPaper_;
245  diffuse_color = 0.5f * materialColorPaper_;
246  specular_color = 0.8f * materialColorPaper_;
247  ambient_color[3] = 1.0f;
248  diffuse_color[3] = 1.0f;
249  specular_color[3] = 1.0f;
250 
251  // Set background color
253 
254  // =============================================================================
255  // Apply to all objects
256  // =============================================================================
258  MaterialNode* mat = o_it->materialNode();
260  mat->set_ambient_color(ambient_color);
261  mat->set_diffuse_color(diffuse_color);
262  mat->set_specular_color(specular_color);
264  }
265 
266  emit updateView();
267 }
268 
269 
270 //-----------------------------------------------------------------------------
271 
277  emit scriptInfo( "setBackgroundColor()" );
278  emit showStatusMessage( tr("Set background color"), 4000 );
279 
280  ACG::Vec4f color;
281  color[0] = _color[0];
282  color[1] = _color[1];
283  color[2] = _color[2];
284  color[3] = 1.0;
285 
287 }
288 
289 //-----------------------------------------------------------------------------
290 
296 void ColorPlugin::setObjectEmissiveColor(int _objectId , Vector4 _color) {
297 
298  BaseObjectData* object;
299  if ( ! PluginFunctions::getObject(_objectId,object) ) {
300  return;
301  }
302 
303  OpenMesh::Vec4f tmp = OpenMesh::Vec4f(_color);
304  object->materialNode()->set_base_color(tmp);
305 
306 }
307 
308 //-----------------------------------------------------------------------------
309 
315 void ColorPlugin::setObjectAmbientColor(int _objectId , Vector4 _color) {
316  BaseObjectData* object;
317  if ( ! PluginFunctions::getObject(_objectId,object) ) {
318  return;
319  }
320 
321  OpenMesh::Vec4f tmp = OpenMesh::Vec4f(_color);
322  object->materialNode()->set_ambient_color(tmp);
323 }
324 
325 //-----------------------------------------------------------------------------
326 
332 void ColorPlugin::setObjectDiffuseColor(int _objectId , Vector4 _color) {
333  BaseObjectData* object;
334  if ( ! PluginFunctions::getObject(_objectId,object) ) {
335  return;
336  }
337 
338  OpenMesh::Vec4f tmp = OpenMesh::Vec4f(_color);
339  object->materialNode()->set_diffuse_color(tmp);
340 }
341 
342 //-----------------------------------------------------------------------------
343 
349 void ColorPlugin::setObjectSpecularColor(int _objectId , Vector4 _color) {
350  BaseObjectData* object;
351  if ( ! PluginFunctions::getObject(_objectId,object) ) {
352  return;
353  }
354 
355  OpenMesh::Vec4f tmp = OpenMesh::Vec4f(_color);
356  object->materialNode()->set_specular_color(tmp);
357 }
358 
359 //-----------------------------------------------------------------------------
360 
367 
368  QColor color;
369  color.setRgbF(_color[0], _color[1], _color[2], _color[3] );
370 
371  QPixmap pic(32,32);
372  pic.fill( color );
373 
374  return QIcon( pic );
375 }
376 
377 
378 //-----------------------------------------------------------------------------
379 
385 QIcon ColorPlugin::generateIcon(QRgb _color){
386 
387  QColor color(_color);
388 
389  QPixmap pic(32,32);
390  pic.fill( color );
391 
392  return QIcon( pic );
393 }
394 
395 
396 //-----------------------------------------------------------------------------
397 
403 QRgb ColorPlugin::getIconColor(QIcon _icon){
404 
405  QRgb rgb = _icon.pixmap(32,32).toImage().pixel(0,0);
406 
407  return rgb;
408 }
409 
410 
411 //-----------------------------------------------------------------------------
412 
418 void ColorPlugin::setNewColor(QIcon _icon, OpenMesh::Vec4f& _color){
419 
420  QColor color( getIconColor(_icon) );
421 
422  _color[0] = color.redF();
423  _color[1] = color.greenF();
424  _color[2] = color.blueF();
425  _color[3] = color.alphaF();
426 }
427 
428 //-----------------------------------------------------------------------------
429 
434 
435  QPushButton* button = dynamic_cast< QPushButton* > ( sender() );
436 
437  if (button != 0){
438 
439  bool ok;
440 
441  QRgb newColor = QColorDialog::getRgba ( getIconColor( button->icon() ) , &ok );
442 
443  if (ok)
444  button->setIcon( generateIcon(newColor) );
445 
446  }
447 }
448 
449 
450 //-----------------------------------------------------------------------------
451 
457 bool ColorPlugin::initializeOptionsWidget(QWidget*& _widget){
458 
459  if (optionsWidget_ == 0){
460 
462 
463  //connect the signals
464  connect(optionsWidget_->backgroundDefault, SIGNAL( clicked() ), this, SLOT( getColorDialog() ) );
465  connect(optionsWidget_->backgroundPaper, SIGNAL( clicked() ), this, SLOT( getColorDialog() ) );
466  connect(optionsWidget_->backgroundPresentation, SIGNAL( clicked() ), this, SLOT( getColorDialog() ) );
467 
468  connect(optionsWidget_->baseDefault, SIGNAL( clicked() ), this, SLOT( getColorDialog() ) );
469  connect(optionsWidget_->basePaper, SIGNAL( clicked() ), this, SLOT( getColorDialog() ) );
470  connect(optionsWidget_->basePresentation, SIGNAL( clicked() ), this, SLOT( getColorDialog() ) );
471 
472  connect(optionsWidget_->materialDefault, SIGNAL( clicked() ), this, SLOT( getColorDialog() ) );
473  connect(optionsWidget_->materialPaper, SIGNAL( clicked() ), this, SLOT( getColorDialog() ) );
474  connect(optionsWidget_->materialPresentation, SIGNAL( clicked() ), this, SLOT( getColorDialog() ) );
475  }
476 
477  //put values into the optionsWidget
478  optionsWidget_->backgroundDefault->setIcon( generateIcon( backgroundColorDefault_ ) );
479  optionsWidget_->backgroundPaper->setIcon( generateIcon( backgroundColorPaper_ ) );
480  optionsWidget_->backgroundPresentation->setIcon( generateIcon( backgroundColorPresentation_ ) );
481 
482  optionsWidget_->baseDefault->setIcon( generateIcon( baseColorDefault_ ) );
483  optionsWidget_->basePaper->setIcon( generateIcon( baseColorPaper_ ) );
484  optionsWidget_->basePresentation->setIcon( generateIcon( baseColorPresentation_ ) );
485 
486  optionsWidget_->materialDefault->setIcon( generateIcon( materialColorDefault_ ) );
487  optionsWidget_->materialPaper->setIcon( generateIcon( materialColorPaper_ ) );
488  optionsWidget_->materialPresentation->setIcon( generateIcon( materialColorPresentation_ ) );
489 
490  optionsWidget_->lineDefault->setValue( lineWidthDefault_ );
491  optionsWidget_->linePaper->setValue( lineWidthPaper_ );
492  optionsWidget_->linePresentation->setValue( lineWidthPresentation_ );
493 
494  _widget = optionsWidget_;
495 
496  return true;
497 }
498 
499 
500 //-----------------------------------------------------------------------------
501 
506 
507  setNewColor(optionsWidget_->backgroundDefault->icon(), backgroundColorDefault_);
508  setNewColor(optionsWidget_->backgroundPaper->icon(), backgroundColorPaper_);
509  setNewColor(optionsWidget_->backgroundPresentation->icon(), backgroundColorPresentation_);
510 
511  setNewColor(optionsWidget_->baseDefault->icon(), baseColorDefault_);
512  setNewColor(optionsWidget_->basePaper->icon(), baseColorPaper_);
513  setNewColor(optionsWidget_->basePresentation->icon(), baseColorPresentation_);
514 
515  setNewColor(optionsWidget_->materialDefault->icon(), materialColorDefault_);
516  setNewColor(optionsWidget_->materialPaper->icon(), materialColorPaper_);
517  setNewColor(optionsWidget_->materialPresentation->icon(), materialColorPresentation_);
518 
519  lineWidthDefault_ = optionsWidget_->lineDefault->value();
520  lineWidthPaper_ = optionsWidget_->linePaper->value();
521  lineWidthPresentation_ = optionsWidget_->linePresentation->value();
522 }
523 
524 
525 //-----------------------------------------------------------------------------
526 
532 void ColorPlugin::convertColor(uint _color, OpenMesh::Vec4f& _vector){
533 
534  QColor color;
535  color.setRgba( _color );
536 
537  _vector[0] = color.redF();
538  _vector[1] = color.greenF();
539  _vector[2] = color.blueF();
540  _vector[3] = color.alphaF();
541 }
542 
543 
544 //-----------------------------------------------------------------------------
545 
552 
553  QColor color;
554  color.setRgbF(_vector[0], _vector[1], _vector[2], _vector[3] );
555 
556  return (uint) color.rgba();
557 }
558 
559 
560 //-----------------------------------------------------------------------------
561 
567 
568  if ( _ini.section_exists("ColorPlugin") ){
569 
570  uint color = 0;
571 
572  if ( _ini.get_entry( color, "ColorPlugin" , "backgroundColorDefault") )
574  if ( _ini.get_entry( color, "ColorPlugin" , "backgroundColorPaper") )
576  if ( _ini.get_entry( color, "ColorPlugin" , "backgroundColorPresentation") )
578 
579  if ( _ini.get_entry( color, "ColorPlugin" , "baseColorDefault") )
581  if ( _ini.get_entry( color, "ColorPlugin" , "baseColorPaper") )
582  convertColor( color, baseColorPaper_ );
583  if ( _ini.get_entry( color, "ColorPlugin" , "baseColorPresentation") )
585 
586  if ( _ini.get_entry( color, "ColorPlugin" , "materialColorDefault") )
588  if ( _ini.get_entry( color, "ColorPlugin" , "materialColorPaper") )
590  if ( _ini.get_entry( color, "ColorPlugin" , "materialColorPresentation") )
592 
593  double width;
594 
595  if ( _ini.get_entry( width, "ColorPlugin" , "lineWidthDefault") )
596  lineWidthDefault_ = width;
597  if ( _ini.get_entry( width, "ColorPlugin" , "lineWidthPaper") )
598  lineWidthPaper_ = width;
599  if ( _ini.get_entry( width, "ColorPlugin" , "lineWidthPresentation") )
600  lineWidthPresentation_ = width;
601 
602  }
603 }
604 
605 
606 //-----------------------------------------------------------------------------
607 
613 std::cerr << "save to ini file\n";
614 
615 
616  _ini.add_entry("ColorPlugin","backgroundColorDefault", convertColor( backgroundColorDefault_ ) );
617  _ini.add_entry("ColorPlugin","backgroundColorPaper", convertColor( backgroundColorPaper_ ) );
618  _ini.add_entry("ColorPlugin","backgroundColorPresentation", convertColor( backgroundColorPresentation_ ) );
619 
620  _ini.add_entry("ColorPlugin","baseColorDefault", convertColor( baseColorDefault_ ) );
621  _ini.add_entry("ColorPlugin","baseColorPaper", convertColor( baseColorPaper_ ) );
622  _ini.add_entry("ColorPlugin","baseColorPresentation", convertColor( baseColorPresentation_ ) );
623 
624  _ini.add_entry("ColorPlugin","materialColorDefault", convertColor( materialColorDefault_ ) );
625  _ini.add_entry("ColorPlugin","materialColorPaper", convertColor( materialColorPaper_ ) );
626  _ini.add_entry("ColorPlugin","materialColorPresentation", convertColor( materialColorPresentation_ ) );
627 
628  _ini.add_entry("ColorPlugin","lineWidthDefault", lineWidthDefault_ );
629  _ini.add_entry("ColorPlugin","lineWidthPaper", lineWidthPaper_ );
630  _ini.add_entry("ColorPlugin","lineWidthPresentation", lineWidthPresentation_ );
631 }
632 
633 
634 
QRgb getIconColor(QIcon _icon)
get the color from a given icon
Definition: ColorPlugin.cc:403
void set_diffuse_color(const Vec4f &_d)
set the diffuse color.
OpenMesh::Vec4f baseColorPresentation_
the options widget to set colors
Definition: ColorPlugin.hh:147
double lineWidthDefault_
the options widget to set colors
Definition: ColorPlugin.hh:150
void setPaperColor()
set the paperColor Preset
Definition: ColorPlugin.cc:229
OpenMesh::Vec4f materialColorDefault_
the options widget to set colors
Definition: ColorPlugin.hh:148
void setObjectEmissiveColor(int _objectId, Vector4 _color)
Definition: ColorPlugin.cc:296
void set_specular_color(const Vec4f &_s)
set the specular color
VectorT< float, 4 > Vec4f
Definition: Vector11T.hh:830
void setPresentationColor()
Set the presentation color preset.
Definition: ColorPlugin.cc:183
OpenMesh::Vec4f materialColorPaper_
the options widget to set colors
Definition: ColorPlugin.hh:148
ColorOptions * optionsWidget_
the options widget to set colors
Definition: ColorPlugin.hh:125
bool section_exists(const QString &_section) const
Check if given section exists in the current INI file.
Definition: INIFile.cc:227
OpenMesh::Vec4f materialColorPresentation_
the options widget to set colors
Definition: ColorPlugin.hh:148
OpenMesh::Vec4f backgroundColorPaper_
the options widget to set colors
Definition: ColorPlugin.hh:146
OpenMesh::Vec4f baseColorPaper_
the options widget to set colors
Definition: ColorPlugin.hh:147
const QStringList ALL_OBJECTS
Iterable object range.
void setBackColor(OpenMesh::Vec4f _color)
Set the background color of the examiner widget.
ColorPlugin()
ConstructorOptionsInterface.
Definition: ColorPlugin.cc:56
OpenMesh::Vec4f backgroundColorDefault_
the options widget to set colors
Definition: ColorPlugin.hh:146
void setObjectSpecularColor(int _objectId, Vector4 _color)
Definition: ColorPlugin.cc:349
void saveIniFileOptions(INIFile &_ini)
Store current color preset to an ini file.
Definition: ColorPlugin.cc:612
void getColorDialog()
display a color dialog
Definition: ColorPlugin.cc:433
static const Vec4f default_clear_color
default value for clear color
Definition: GLState.hh:897
bool getObject(const int _identifier, BaseObject *&_object)
Get the object which has the given identifier.
bool initializeOptionsWidget(QWidget *&_widget)
generate an optionsWidget to change color presets
Definition: ColorPlugin.cc:457
static const Vec4f default_base_color
default value for base color
Definition: GLState.hh:899
void set_line_width(float _sz)
set line width (default: 1.0)
static const Vec4f default_diffuse_color
default value for diffuse color
Definition: GLState.hh:903
QIcon generateIcon(QRgb _color)
generate an icon from a given color
Definition: ColorPlugin.cc:385
double lineWidthPresentation_
the options widget to set colors
Definition: ColorPlugin.hh:150
void convertColor(uint _color, OpenMesh::Vec4f &_vector)
convert betweeen uint and Vec4f
Definition: ColorPlugin.cc:532
OpenMesh::Vec4f backgroundColorPresentation_
the options widget to set colors
Definition: ColorPlugin.hh:146
void setBackgroundColor(Vector _color)
Set the backgroundColor.
Definition: ColorPlugin.cc:276
#define VIEWMENU
The Menu will be added inside the View Menu.
void setObjectDiffuseColor(int _objectId, Vector4 _color)
Definition: ColorPlugin.cc:332
void applyOptions()
Store the changed color presets when the apply Button was hit.
Definition: ColorPlugin.cc:505
void set_ambient_color(const Vec4f &_a)
set the ambient color.
void add_entry(const QString &_section, const QString &_key, const QString &_value)
Addition / modification of a string entry.
Definition: INIFile.cc:257
OpenMesh::Vec4f baseColorDefault_
the options widget to set colors
Definition: ColorPlugin.hh:147
void setNewColor(QIcon _icon, OpenMesh::Vec4f &_color)
set the color of a color vector to the one in the given icon
Definition: ColorPlugin.cc:418
double lineWidthPaper_
the options widget to set colors
Definition: ColorPlugin.hh:150
DLLEXPORT ObjectIterator objectsEnd()
Return Iterator to Object End.
a class which provides an link generator for WhatsThisMessages linking to the user doc If you have an...
void setDefaultColor()
set the defaultColor preset
Definition: ColorPlugin.cc:137
void set_base_color(const Vec4f &_c)
set the base color ( Same as set_emission(const Vec4f& _c) )
void loadIniFileOptions(INIFile &_ini)
read color preset from ini file
Definition: ColorPlugin.cc:566
void pluginsInitialized()
initialize the toolbar and menubar
Definition: ColorPlugin.cc:83
void setObjectAmbientColor(int _objectId, Vector4 _color)
Definition: ColorPlugin.cc:315
Class for the handling of simple configuration files.
Definition: INIFile.hh:99
bool get_entry(QString &_val, const QString &_section, const QString &_key) const
Access to a string entry.
Definition: INIFile.cc:433