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 /*===========================================================================*\
43 * *
44 * $Revision$ *
45 * $LastChangedBy$ *
46 * $Date$ *
47 * *
48 \*===========================================================================*/
49 
50 #include "ColorPlugin.hh"
51 
52 #if QT_VERSION >= 0x050000
53 #else
54  #include <QtGui>
55 #endif
56 
59 
60 
61 //-----------------------------------------------------------------------------
62 
66 ColorPlugin::ColorPlugin() : optionsWidget_(0)
67 {
68 
69  //set default values for colors
70 
72  backgroundColorPaper_ = OpenMesh::Vec4f(1.00f, 1.00f, 1.00f, 1.0f);
73  backgroundColorPresentation_ = OpenMesh::Vec4f(0.0f, 0.188f, 0.062f, 1.0f);
75  baseColorPaper_ = OpenMesh::Vec4f(0.00f, 0.00f, 0.00f, 1.0f);
76  baseColorPresentation_ = OpenMesh::Vec4f(0.88f, 0.88f, 0.188f, 1.0f);
78  materialColorPaper_ = OpenMesh::Vec4f(0.12f, 0.76f, 0.62f, 1.0f);
79  materialColorPresentation_ = OpenMesh::Vec4f(0.941f, 0.439f, 0.31f, 1.0f);
80 
81  lineWidthDefault_ = 1.0;
82  lineWidthPaper_ = 2.0;
84 
85 }
86 
87 
88 //-----------------------------------------------------------------------------
89 
94 {
95  // =============================================================================
96  // Add a Menu for color selection
97  // =============================================================================
98  QMenu *colorMenu = new QMenu(tr("&Color schemes"));
99 
100  colorMenu->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"format-stroke-color.png"));
101  emit addMenubarAction(colorMenu->menuAction(), VIEWMENU );
102 
103  // =============================================================================
104  // Add Menu entries
105  // =============================================================================
106  WhatsThisGenerator whatsThis("Color");
107 
108  QAction* AC_set_Default_color = new QAction(tr("&Default colors"), this);
109  AC_set_Default_color->setStatusTip(tr("Set Default Colors"));
110  AC_set_Default_color->setWhatsThis(tr("Set colors to default colors. ")+whatsThis.generateLink());
111  AC_set_Default_color->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"color-default.png"));
112  connect(AC_set_Default_color, SIGNAL(triggered()), this, SLOT(setDefaultColor()));
113  colorMenu->addAction(AC_set_Default_color);
114 
115  QAction* AC_set_Presentation_color = new QAction(tr("&Presentation colors"), this);
116  AC_set_Presentation_color->setStatusTip(tr("Set Presentation Colors"));
117  AC_set_Presentation_color->setWhatsThis(tr("Set colors to presentation colors. ")+whatsThis.generateLink());
118  AC_set_Presentation_color->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"color-powerpoint.png"));
119  connect(AC_set_Presentation_color, SIGNAL(triggered()), this, SLOT(setPresentationColor()));
120  colorMenu->addAction(AC_set_Presentation_color);
121 
122  QAction* AC_set_Paper_color = new QAction(tr("&Paper colors"), this);
123  AC_set_Paper_color->setStatusTip(tr("Set Paper Colors"));
124  AC_set_Paper_color->setWhatsThis(tr("Set colors to colors for papers. ")+whatsThis.generateLink());
125  AC_set_Paper_color->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"color-paper.png"));
126  connect(AC_set_Paper_color, SIGNAL(triggered()), this, SLOT(setPaperColor()));
127  colorMenu->addAction(AC_set_Paper_color);
128 
129  // =============================================================================
130  // Create Tool bar with same contents
131  // =============================================================================
132 
133  QToolBar* toolbar = new QToolBar(tr("Color Toolbar"));
134  toolbar->addAction(AC_set_Default_color);
135  toolbar->addAction(AC_set_Presentation_color);
136  toolbar->addAction(AC_set_Paper_color);
137  emit addToolbar( toolbar );
138 
139 }
140 
141 
142 //-----------------------------------------------------------------------------
143 
148 
149  // =============================================================================
150  // Give user feedback
151  // =============================================================================
152  emit scriptInfo( "setDefaultColor()" );
153  emit showStatusMessage( tr("Set to default Colors"), 4000 );
154 
155  // =============================================================================
156  // Define the new colors
157  // =============================================================================
158  OpenMesh::Vec4f ambient_color,
159  diffuse_color,
160  specular_color;
161 
162  ambient_color = 0.2f * materialColorDefault_;
163  diffuse_color = 0.6f * materialColorDefault_;
164  specular_color = 0.8f * materialColorDefault_;
165  ambient_color[3] = 1.0f;
166  diffuse_color[3] = 1.0f;
167  specular_color[3] = 1.0f;
168 
169  // Set background color
171 
172  // =============================================================================
173  // Apply to all objects
174  // =============================================================================
176  MaterialNode* mat = o_it->materialNode();
178  mat->set_ambient_color(ambient_color);
179  mat->set_diffuse_color(diffuse_color);
180  mat->set_specular_color(specular_color);
182  }
183 
184  emit updateView();
185 }
186 
187 
188 //-----------------------------------------------------------------------------
189 
194 
195  // =============================================================================
196  // Give user feedback
197  // =============================================================================
198  emit scriptInfo( "setPresentationColor()" );
199  emit showStatusMessage( tr("Set to Presentation Colors"), 4000 );
200 
201  // =============================================================================
202  // Define the new colors
203  // =============================================================================
204  OpenMesh::Vec4f ambient_color,
205  diffuse_color,
206  specular_color;
207 
208  ambient_color = 0.2f * materialColorPresentation_;
209  diffuse_color = 0.6f * materialColorPresentation_;
210  specular_color = 0.8f * materialColorPresentation_;
211  ambient_color[3] = 1.0f;
212  diffuse_color[3] = 1.0f;
213  specular_color[3] = 1.0f;
214 
215  // Set background color
217 
218  // =============================================================================
219  // Apply to all objects
220  // =============================================================================
222  MaterialNode* mat = o_it->materialNode();
224  mat->set_ambient_color(ambient_color);
225  mat->set_diffuse_color(diffuse_color);
226  mat->set_specular_color(specular_color);
228  }
229 
230  emit updateView();
231 }
232 
233 
234 //-----------------------------------------------------------------------------
235 
240 
241  // =============================================================================
242  // Give user feedback
243  // =============================================================================
244  emit scriptInfo( "setPaperColor()" );
245  emit showStatusMessage( tr("Set to Paper Colors"), 4000 );
246 
247  // =============================================================================
248  // Define the new colors
249  // =============================================================================
250  OpenMesh::Vec4f ambient_color,
251  diffuse_color,
252  specular_color;
253 
254  ambient_color = 0.2f * materialColorPaper_;
255  diffuse_color = 0.5f * materialColorPaper_;
256  specular_color = 0.8f * materialColorPaper_;
257  ambient_color[3] = 1.0f;
258  diffuse_color[3] = 1.0f;
259  specular_color[3] = 1.0f;
260 
261  // Set background color
263 
264  // =============================================================================
265  // Apply to all objects
266  // =============================================================================
268  MaterialNode* mat = o_it->materialNode();
270  mat->set_ambient_color(ambient_color);
271  mat->set_diffuse_color(diffuse_color);
272  mat->set_specular_color(specular_color);
274  }
275 
276  emit updateView();
277 }
278 
279 
280 //-----------------------------------------------------------------------------
281 
287  emit scriptInfo( "setBackgroundColor()" );
288  emit showStatusMessage( tr("Set background color"), 4000 );
289 
290  ACG::Vec4f color;
291  color[0] = _color[0];
292  color[1] = _color[1];
293  color[2] = _color[2];
294  color[3] = 1.0;
295 
297 }
298 
299 //-----------------------------------------------------------------------------
300 
306 void ColorPlugin::setObjectEmissiveColor(int _objectId , Vector4 _color) {
307 
308  BaseObjectData* object;
309  if ( ! PluginFunctions::getObject(_objectId,object) ) {
310  return;
311  }
312 
313  OpenMesh::Vec4f tmp = OpenMesh::Vec4f(_color);
314  object->materialNode()->set_base_color(tmp);
315 
316 }
317 
318 //-----------------------------------------------------------------------------
319 
325 void ColorPlugin::setObjectAmbientColor(int _objectId , Vector4 _color) {
326  BaseObjectData* object;
327  if ( ! PluginFunctions::getObject(_objectId,object) ) {
328  return;
329  }
330 
331  OpenMesh::Vec4f tmp = OpenMesh::Vec4f(_color);
332  object->materialNode()->set_ambient_color(tmp);
333 }
334 
335 //-----------------------------------------------------------------------------
336 
342 void ColorPlugin::setObjectDiffuseColor(int _objectId , Vector4 _color) {
343  BaseObjectData* object;
344  if ( ! PluginFunctions::getObject(_objectId,object) ) {
345  return;
346  }
347 
348  OpenMesh::Vec4f tmp = OpenMesh::Vec4f(_color);
349  object->materialNode()->set_diffuse_color(tmp);
350 }
351 
352 //-----------------------------------------------------------------------------
353 
359 void ColorPlugin::setObjectSpecularColor(int _objectId , Vector4 _color) {
360  BaseObjectData* object;
361  if ( ! PluginFunctions::getObject(_objectId,object) ) {
362  return;
363  }
364 
365  OpenMesh::Vec4f tmp = OpenMesh::Vec4f(_color);
366  object->materialNode()->set_specular_color(tmp);
367 }
368 
369 //-----------------------------------------------------------------------------
370 
377 
378  QColor color;
379  color.setRgbF(_color[0], _color[1], _color[2], _color[3] );
380 
381  QPixmap pic(32,32);
382  pic.fill( color );
383 
384  return QIcon( pic );
385 }
386 
387 
388 //-----------------------------------------------------------------------------
389 
395 QIcon ColorPlugin::generateIcon(QRgb _color){
396 
397  QColor color(_color);
398 
399  QPixmap pic(32,32);
400  pic.fill( color );
401 
402  return QIcon( pic );
403 }
404 
405 
406 //-----------------------------------------------------------------------------
407 
413 QRgb ColorPlugin::getIconColor(QIcon _icon){
414 
415  QRgb rgb = _icon.pixmap(32,32).toImage().pixel(0,0);
416 
417  return rgb;
418 }
419 
420 
421 //-----------------------------------------------------------------------------
422 
428 void ColorPlugin::setNewColor(QIcon _icon, OpenMesh::Vec4f& _color){
429 
430  QColor color( getIconColor(_icon) );
431 
432  _color[0] = color.redF();
433  _color[1] = color.greenF();
434  _color[2] = color.blueF();
435  _color[3] = color.alphaF();
436 }
437 
438 //-----------------------------------------------------------------------------
439 
444 
445  QPushButton* button = dynamic_cast< QPushButton* > ( sender() );
446 
447  if (button != 0){
448 
449  bool ok;
450 
451  QRgb newColor = QColorDialog::getRgba ( getIconColor( button->icon() ) , &ok );
452 
453  if (ok)
454  button->setIcon( generateIcon(newColor) );
455 
456  }
457 }
458 
459 
460 //-----------------------------------------------------------------------------
461 
467 bool ColorPlugin::initializeOptionsWidget(QWidget*& _widget){
468 
469  if (optionsWidget_ == 0){
470 
472 
473  //connect the signals
474  connect(optionsWidget_->backgroundDefault, SIGNAL( clicked() ), this, SLOT( getColorDialog() ) );
475  connect(optionsWidget_->backgroundPaper, SIGNAL( clicked() ), this, SLOT( getColorDialog() ) );
476  connect(optionsWidget_->backgroundPresentation, SIGNAL( clicked() ), this, SLOT( getColorDialog() ) );
477 
478  connect(optionsWidget_->baseDefault, SIGNAL( clicked() ), this, SLOT( getColorDialog() ) );
479  connect(optionsWidget_->basePaper, SIGNAL( clicked() ), this, SLOT( getColorDialog() ) );
480  connect(optionsWidget_->basePresentation, SIGNAL( clicked() ), this, SLOT( getColorDialog() ) );
481 
482  connect(optionsWidget_->materialDefault, SIGNAL( clicked() ), this, SLOT( getColorDialog() ) );
483  connect(optionsWidget_->materialPaper, SIGNAL( clicked() ), this, SLOT( getColorDialog() ) );
484  connect(optionsWidget_->materialPresentation, SIGNAL( clicked() ), this, SLOT( getColorDialog() ) );
485  }
486 
487  //put values into the optionsWidget
488  optionsWidget_->backgroundDefault->setIcon( generateIcon( backgroundColorDefault_ ) );
489  optionsWidget_->backgroundPaper->setIcon( generateIcon( backgroundColorPaper_ ) );
490  optionsWidget_->backgroundPresentation->setIcon( generateIcon( backgroundColorPresentation_ ) );
491 
492  optionsWidget_->baseDefault->setIcon( generateIcon( baseColorDefault_ ) );
493  optionsWidget_->basePaper->setIcon( generateIcon( baseColorPaper_ ) );
494  optionsWidget_->basePresentation->setIcon( generateIcon( baseColorPresentation_ ) );
495 
496  optionsWidget_->materialDefault->setIcon( generateIcon( materialColorDefault_ ) );
497  optionsWidget_->materialPaper->setIcon( generateIcon( materialColorPaper_ ) );
498  optionsWidget_->materialPresentation->setIcon( generateIcon( materialColorPresentation_ ) );
499 
500  optionsWidget_->lineDefault->setValue( lineWidthDefault_ );
501  optionsWidget_->linePaper->setValue( lineWidthPaper_ );
502  optionsWidget_->linePresentation->setValue( lineWidthPresentation_ );
503 
504  _widget = optionsWidget_;
505 
506  return true;
507 }
508 
509 
510 //-----------------------------------------------------------------------------
511 
516 
517  setNewColor(optionsWidget_->backgroundDefault->icon(), backgroundColorDefault_);
518  setNewColor(optionsWidget_->backgroundPaper->icon(), backgroundColorPaper_);
519  setNewColor(optionsWidget_->backgroundPresentation->icon(), backgroundColorPresentation_);
520 
521  setNewColor(optionsWidget_->baseDefault->icon(), baseColorDefault_);
522  setNewColor(optionsWidget_->basePaper->icon(), baseColorPaper_);
523  setNewColor(optionsWidget_->basePresentation->icon(), baseColorPresentation_);
524 
525  setNewColor(optionsWidget_->materialDefault->icon(), materialColorDefault_);
526  setNewColor(optionsWidget_->materialPaper->icon(), materialColorPaper_);
527  setNewColor(optionsWidget_->materialPresentation->icon(), materialColorPresentation_);
528 
529  lineWidthDefault_ = optionsWidget_->lineDefault->value();
530  lineWidthPaper_ = optionsWidget_->linePaper->value();
531  lineWidthPresentation_ = optionsWidget_->linePresentation->value();
532 }
533 
534 
535 //-----------------------------------------------------------------------------
536 
542 void ColorPlugin::convertColor(uint _color, OpenMesh::Vec4f& _vector){
543 
544  QColor color;
545  color.setRgba( _color );
546 
547  _vector[0] = color.redF();
548  _vector[1] = color.greenF();
549  _vector[2] = color.blueF();
550  _vector[3] = color.alphaF();
551 }
552 
553 
554 //-----------------------------------------------------------------------------
555 
562 
563  QColor color;
564  color.setRgbF(_vector[0], _vector[1], _vector[2], _vector[3] );
565 
566  return (uint) color.rgba();
567 }
568 
569 
570 //-----------------------------------------------------------------------------
571 
577 
578  if ( _ini.section_exists("ColorPlugin") ){
579 
580  uint color = 0;
581 
582  if ( _ini.get_entry( color, "ColorPlugin" , "backgroundColorDefault") )
584  if ( _ini.get_entry( color, "ColorPlugin" , "backgroundColorPaper") )
586  if ( _ini.get_entry( color, "ColorPlugin" , "backgroundColorPresentation") )
588 
589  if ( _ini.get_entry( color, "ColorPlugin" , "baseColorDefault") )
591  if ( _ini.get_entry( color, "ColorPlugin" , "baseColorPaper") )
592  convertColor( color, baseColorPaper_ );
593  if ( _ini.get_entry( color, "ColorPlugin" , "baseColorPresentation") )
595 
596  if ( _ini.get_entry( color, "ColorPlugin" , "materialColorDefault") )
598  if ( _ini.get_entry( color, "ColorPlugin" , "materialColorPaper") )
600  if ( _ini.get_entry( color, "ColorPlugin" , "materialColorPresentation") )
602 
603  double width;
604 
605  if ( _ini.get_entry( width, "ColorPlugin" , "lineWidthDefault") )
606  lineWidthDefault_ = width;
607  if ( _ini.get_entry( width, "ColorPlugin" , "lineWidthPaper") )
608  lineWidthPaper_ = width;
609  if ( _ini.get_entry( width, "ColorPlugin" , "lineWidthPresentation") )
610  lineWidthPresentation_ = width;
611 
612  }
613 }
614 
615 
616 //-----------------------------------------------------------------------------
617 
623 std::cerr << "save to ini file\n";
624 
625 
626  _ini.add_entry("ColorPlugin","backgroundColorDefault", convertColor( backgroundColorDefault_ ) );
627  _ini.add_entry("ColorPlugin","backgroundColorPaper", convertColor( backgroundColorPaper_ ) );
628  _ini.add_entry("ColorPlugin","backgroundColorPresentation", convertColor( backgroundColorPresentation_ ) );
629 
630  _ini.add_entry("ColorPlugin","baseColorDefault", convertColor( baseColorDefault_ ) );
631  _ini.add_entry("ColorPlugin","baseColorPaper", convertColor( baseColorPaper_ ) );
632  _ini.add_entry("ColorPlugin","baseColorPresentation", convertColor( baseColorPresentation_ ) );
633 
634  _ini.add_entry("ColorPlugin","materialColorDefault", convertColor( materialColorDefault_ ) );
635  _ini.add_entry("ColorPlugin","materialColorPaper", convertColor( materialColorPaper_ ) );
636  _ini.add_entry("ColorPlugin","materialColorPresentation", convertColor( materialColorPresentation_ ) );
637 
638  _ini.add_entry("ColorPlugin","lineWidthDefault", lineWidthDefault_ );
639  _ini.add_entry("ColorPlugin","lineWidthPaper", lineWidthPaper_ );
640  _ini.add_entry("ColorPlugin","lineWidthPresentation", lineWidthPresentation_ );
641 }
642 
643 #if QT_VERSION < 0x050000
644 Q_EXPORT_PLUGIN2( colorplugin , ColorPlugin );
645 #endif
646 
647 
double lineWidthPresentation_
the options widget to set colors
Definition: ColorPlugin.hh:161
void pluginsInitialized()
initialize the toolbar and menubar
Definition: ColorPlugin.cc:93
OpenMesh::Vec4f baseColorPresentation_
the options widget to set colors
Definition: ColorPlugin.hh:158
static const Vec4f default_diffuse_color
default value for diffuse color
Definition: GLState.hh:906
void saveIniFileOptions(INIFile &_ini)
Store current color preset to an ini file.
Definition: ColorPlugin.cc:622
void set_specular_color(const Vec4f &_s)
set the specular color
OpenMesh::Vec4f materialColorDefault_
the options widget to set colors
Definition: ColorPlugin.hh:159
double lineWidthDefault_
the options widget to set colors
Definition: ColorPlugin.hh:161
OpenMesh::Vec4f backgroundColorPresentation_
the options widget to set colors
Definition: ColorPlugin.hh:157
double lineWidthPaper_
the options widget to set colors
Definition: ColorPlugin.hh:161
bool getObject(int _identifier, BSplineCurveObject *&_object)
OpenMesh::Vec4f materialColorPresentation_
the options widget to set colors
Definition: ColorPlugin.hh:159
void setPresentationColor()
Set the presentation color preset.
Definition: ColorPlugin.cc:193
void setPaperColor()
set the paperColor Preset
Definition: ColorPlugin.cc:239
ColorOptions * optionsWidget_
the options widget to set colors
Definition: ColorPlugin.hh:136
void set_ambient_color(const Vec4f &_a)
set the ambient color.
static const Vec4f default_clear_color
default value for clear color
Definition: GLState.hh:900
void setObjectAmbientColor(int _objectId, Vector4 _color)
Definition: ColorPlugin.cc:325
static const Vec4f default_base_color
default value for base color
Definition: GLState.hh:902
const QStringList ALL_OBJECTS
Iterable object range.
void convertColor(uint _color, OpenMesh::Vec4f &_vector)
convert betweeen uint and Vec4f
Definition: ColorPlugin.cc:542
void getColorDialog()
display a color dialog
Definition: ColorPlugin.cc:443
bool initializeOptionsWidget(QWidget *&_widget)
generate an optionsWidget to change color presets
Definition: ColorPlugin.cc:467
a class which provides an link generator for WhatsThisMessages linking to the user doc If you have an...
bool get_entry(QString &_val, const QString &_section, const QString &_key) const
Access to a string entry.
Definition: INIFile.cc:439
void setNewColor(QIcon _icon, OpenMesh::Vec4f &_color)
set the color of a color vector to the one in the given icon
Definition: ColorPlugin.cc:428
OpenMesh::Vec4f backgroundColorPaper_
the options widget to set colors
Definition: ColorPlugin.hh:157
VectorT< float, 4 > Vec4f
Definition: Vector11T.hh:788
void set_diffuse_color(const Vec4f &_d)
set the diffuse color.
ColorPlugin()
ConstructorOptionsInterface.
Definition: ColorPlugin.cc:66
bool section_exists(const QString &_section) const
Check if given section exists in the current INI file.
Definition: INIFile.cc:233
void applyOptions()
Store the changed color presets when the apply Button was hit.
Definition: ColorPlugin.cc:515
void setBackColor(OpenMesh::Vec4f _color)
Set the background color of the examiner widget.
Class for the handling of simple configuration files.
Definition: INIFile.hh:105
void setDefaultColor()
set the defaultColor preset
Definition: ColorPlugin.cc:147
OpenMesh::Vec4f backgroundColorDefault_
the options widget to set colors
Definition: ColorPlugin.hh:157
void set_line_width(float _sz)
set line width (default: 1.0)
void loadIniFileOptions(INIFile &_ini)
read color preset from ini file
Definition: ColorPlugin.cc:576
#define VIEWMENU
The Menu will be added inside the View Menu.
QRgb getIconColor(QIcon _icon)
get the color from a given icon
Definition: ColorPlugin.cc:413
QIcon generateIcon(QRgb _color)
generate an icon from a given color
Definition: ColorPlugin.cc:395
void setObjectDiffuseColor(int _objectId, Vector4 _color)
Definition: ColorPlugin.cc:342
void setObjectEmissiveColor(int _objectId, Vector4 _color)
Definition: ColorPlugin.cc:306
void add_entry(const QString &_section, const QString &_key, const QString &_value)
Addition / modification of a string entry.
Definition: INIFile.cc:263
OpenMesh::Vec4f materialColorPaper_
the options widget to set colors
Definition: ColorPlugin.hh:159
void set_base_color(const Vec4f &_c)
set the base color
OpenMesh::Vec4f baseColorPaper_
the options widget to set colors
Definition: ColorPlugin.hh:158
OpenMesh::Vec4f baseColorDefault_
the options widget to set colors
Definition: ColorPlugin.hh:158
DLLEXPORT ObjectIterator objectsEnd()
Return Iterator to Object End.
void setBackgroundColor(Vector _color)
Set the backgroundColor.
Definition: ColorPlugin.cc:286
void setObjectSpecularColor(int _objectId, Vector4 _color)
Definition: ColorPlugin.cc:359