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
45 #include <OpenFlipper/BasePlugin/PluginFunctions.hh>
46 #include <OpenFlipper/common/GlobalOptions.hh>
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
61 backgroundColorDefault_ = ACG::GLState::default_clear_color;
62 backgroundColorPaper_ = OpenMesh::Vec4f(1.00f, 1.00f, 1.00f, 1.0f);
63 backgroundColorPresentation_ = OpenMesh::Vec4f(0.0f, 0.188f, 0.062f, 1.0f);
64 baseColorDefault_ = ACG::GLState::default_base_color;
65 baseColorPaper_ = OpenMesh::Vec4f(0.00f, 0.00f, 0.00f, 1.0f);
66 baseColorPresentation_ = OpenMesh::Vec4f(0.88f, 0.88f, 0.188f, 1.0f);
67 materialColorDefault_ = ACG::GLState::default_diffuse_color;
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;
73 lineWidthPresentation_ = 1.0;
74
75 }
76
77
78 //-----------------------------------------------------------------------------
79
83 void ColorPlugin::pluginsInitialized()
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
137 void ColorPlugin::setDefaultColor() {
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
160 PluginFunctions::setBackColor( backgroundColorDefault_ );
161
162 // =============================================================================
163 // Apply to all objects
164 // =============================================================================
165 for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::ALL_OBJECTS) ; o_it != PluginFunctions::objectsEnd(); ++o_it) {
166 MaterialNode* mat = o_it->materialNode();
167 mat->set_base_color( baseColorDefault_ );
168 mat->set_ambient_color(ambient_color);
169 mat->set_diffuse_color(diffuse_color);
170 mat->set_specular_color(specular_color);
171 mat->set_line_width( lineWidthDefault_ );
172 }
173
174 emit updateView();
175 }
176
177
178 //-----------------------------------------------------------------------------
179
183 void ColorPlugin::setPresentationColor() {
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
206 PluginFunctions::setBackColor( backgroundColorPresentation_ );
207
208 // =============================================================================
209 // Apply to all objects
210 // =============================================================================
211 for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::ALL_OBJECTS) ; o_it != PluginFunctions::objectsEnd(); ++o_it) {
212 MaterialNode* mat = o_it->materialNode();
213 mat->set_base_color( baseColorPresentation_ );
214 mat->set_ambient_color(ambient_color);
215 mat->set_diffuse_color(diffuse_color);
216 mat->set_specular_color(specular_color);
217 mat->set_line_width( lineWidthPresentation_ );
218 }
219
220 emit updateView();
221 }
222
223
224 //-----------------------------------------------------------------------------
225
229 void ColorPlugin::setPaperColor() {
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
252 PluginFunctions::setBackColor( backgroundColorPaper_ );
253
254 // =============================================================================
255 // Apply to all objects
256 // =============================================================================
257 for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::ALL_OBJECTS) ; o_it != PluginFunctions::objectsEnd(); ++o_it) {
258 MaterialNode* mat = o_it->materialNode();
259 mat->set_base_color( baseColorPaper_ );
260 mat->set_ambient_color(ambient_color);
261 mat->set_diffuse_color(diffuse_color);
262 mat->set_specular_color(specular_color);
263 mat->set_line_width( lineWidthPaper_ );
264 }
265
266 emit updateView();
267 }
268
269
270 //-----------------------------------------------------------------------------
271
276 void ColorPlugin::setBackgroundColor( Vector _color ) {
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
286 PluginFunctions::setBackColor(color);
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
366 QIcon ColorPlugin::generateIcon(OpenMesh::Vec4f _color){
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
433 void ColorPlugin::getColorDialog(){
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
461 optionsWidget_ = new ColorOptions();
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
505 void ColorPlugin::applyOptions(){
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
551 uint ColorPlugin::convertColor(OpenMesh::Vec4f& _vector){
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
566 void ColorPlugin::loadIniFileOptions(INIFile& _ini){
567
568 if ( _ini.section_exists("ColorPlugin") ){
569
570 uint color = 0;
571
572 if ( _ini.get_entry( color, "ColorPlugin" , "backgroundColorDefault") )
573 convertColor( color, backgroundColorDefault_ );
574 if ( _ini.get_entry( color, "ColorPlugin" , "backgroundColorPaper") )
575 convertColor( color, backgroundColorPaper_ );
576 if ( _ini.get_entry( color, "ColorPlugin" , "backgroundColorPresentation") )
577 convertColor( color, backgroundColorPresentation_ );
578
579 if ( _ini.get_entry( color, "ColorPlugin" , "baseColorDefault") )
580 convertColor( color, baseColorDefault_ );
581 if ( _ini.get_entry( color, "ColorPlugin" , "baseColorPaper") )
582 convertColor( color, baseColorPaper_ );
583 if ( _ini.get_entry( color, "ColorPlugin" , "baseColorPresentation") )
584 convertColor( color, baseColorPresentation_ );
585
586 if ( _ini.get_entry( color, "ColorPlugin" , "materialColorDefault") )
587 convertColor( color, materialColorDefault_ );
588 if ( _ini.get_entry( color, "ColorPlugin" , "materialColorPaper") )
589 convertColor( color, materialColorPaper_ );
590 if ( _ini.get_entry( color, "ColorPlugin" , "materialColorPresentation") )
591 convertColor( color, 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
612 void ColorPlugin::saveIniFileOptions(INIFile& _ini){
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
WhatsThisGenerator
a class which provides an link generator for WhatsThisMessages linking to the user doc If you have an...
Definition: WhatsThisGenerator.hh:65
ColorPlugin::saveIniFileOptions
void saveIniFileOptions(INIFile &_ini)
Store current color preset to an ini file.
Definition: ColorPlugin.cc:612
ColorPlugin::baseColorDefault_
OpenMesh::Vec4f baseColorDefault_
the options widget to set colors
Definition: ColorPlugin.hh:147
ACG::GLState::default_base_color
static const Vec4f default_base_color
default value for base color
Definition: GLState.hh:899
ACG::GLState::default_diffuse_color
static const Vec4f default_diffuse_color
default value for diffuse color
Definition: GLState.hh:903
ACG::GLState::default_clear_color
static const Vec4f default_clear_color
default value for clear color
Definition: GLState.hh:897
VIEWMENU
#define VIEWMENU
The Menu will be added inside the View Menu.
Definition: MenuInterface.hh:54
ColorPlugin::backgroundColorPaper_
OpenMesh::Vec4f backgroundColorPaper_
the options widget to set colors
Definition: ColorPlugin.hh:146
ACG::SceneGraph::MaterialNode::set_specular_color
void set_specular_color(const Vec4f &_s)
set the specular color
Definition: MaterialNode.hh:441
ColorPlugin::materialColorDefault_
OpenMesh::Vec4f materialColorDefault_
the options widget to set colors
Definition: ColorPlugin.hh:148
ColorPlugin::lineWidthPresentation_
double lineWidthPresentation_
the options widget to set colors
Definition: ColorPlugin.hh:150
ColorPlugin::convertColor
void convertColor(uint _color, OpenMesh::Vec4f &_vector)
convert betweeen uint and Vec4f
Definition: ColorPlugin.cc:532
INIFile::add_entry
void add_entry(const QString &_section, const QString &_key, const QString &_value)
Addition / modification of a string entry.
Definition: INIFile.cc:257
PluginFunctions::getObject
bool getObject(const int _identifier, BaseObject *&_object)
Get the object which has the given identifier.
Definition: PluginFunctions.cc:296
GlobalOptions.hh
ACG::SceneGraph::MaterialNode::set_ambient_color
void set_ambient_color(const Vec4f &_a)
set the ambient color.
Definition: MaterialNode.hh:431
ColorPlugin::ColorPlugin
ColorPlugin()
ConstructorOptionsInterface.
Definition: ColorPlugin.cc:56
ACG::SceneGraph::MaterialNode::set_line_width
void set_line_width(float _sz)
set line width (default: 1.0)
Definition: MaterialNode.hh:491
OpenMesh::VectorT< float, 4 >
ColorPlugin::baseColorPresentation_
OpenMesh::Vec4f baseColorPresentation_
the options widget to set colors
Definition: ColorPlugin.hh:147
PluginFunctions::ALL_OBJECTS
const QStringList ALL_OBJECTS
Iterable object range.
Definition: PluginFunctions.hh:430
INIFile::get_entry
bool get_entry(QString &_val, const QString &_section, const QString &_key) const
Access to a string entry.
Definition: INIFile.cc:433
ColorPlugin::backgroundColorDefault_
OpenMesh::Vec4f backgroundColorDefault_
the options widget to set colors
Definition: ColorPlugin.hh:146
ColorPlugin::setNewColor
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
ColorPlugin::setPaperColor
void setPaperColor()
set the paperColor Preset
Definition: ColorPlugin.cc:229
PluginFunctions.hh
ColorPlugin::setBackgroundColor
void setBackgroundColor(Vector _color)
Set the backgroundColor.
Definition: ColorPlugin.cc:276
ACG::SceneGraph::MaterialNode
Definition: MaterialNode.hh:338
ColorPlugin::generateIcon
QIcon generateIcon(QRgb _color)
generate an icon from a given color
Definition: ColorPlugin.cc:385
ColorPlugin::lineWidthPaper_
double lineWidthPaper_
the options widget to set colors
Definition: ColorPlugin.hh:150
ColorPlugin::applyOptions
void applyOptions()
Store the changed color presets when the apply Button was hit.
Definition: ColorPlugin.cc:505
ACG::SceneGraph::MaterialNode::set_diffuse_color
void set_diffuse_color(const Vec4f &_d)
set the diffuse color.
Definition: MaterialNode.hh:436
ColorPlugin::loadIniFileOptions
void loadIniFileOptions(INIFile &_ini)
read color preset from ini file
Definition: ColorPlugin.cc:566
PluginFunctions::objectsEnd
DLLEXPORT ObjectIterator objectsEnd()
Return Iterator to Object End.
Definition: PluginFunctionsIterator.cc:177
ColorPlugin::setObjectEmissiveColor
void setObjectEmissiveColor(int _objectId, Vector4 _color)
Definition: ColorPlugin.cc:296
ColorPlugin::getColorDialog
void getColorDialog()
display a color dialog
Definition: ColorPlugin.cc:433
PluginFunctions::ObjectIterator
Core Data Iterator.
Definition: PluginFunctions.hh:441
ColorPlugin::getIconColor
QRgb getIconColor(QIcon _icon)
get the color from a given icon
Definition: ColorPlugin.cc:403
ColorPlugin::setDefaultColor
void setDefaultColor()
set the defaultColor preset
Definition: ColorPlugin.cc:137
BaseObjectData
Definition: BaseObjectData.hh:102
ColorPlugin::materialColorPresentation_
OpenMesh::Vec4f materialColorPresentation_
the options widget to set colors
Definition: ColorPlugin.hh:148
ColorPlugin::pluginsInitialized
void pluginsInitialized()
initialize the toolbar and menubar
Definition: ColorPlugin.cc:83
ColorPlugin::setObjectSpecularColor
void setObjectSpecularColor(int _objectId, Vector4 _color)
Definition: ColorPlugin.cc:349
ColorPlugin::setObjectAmbientColor
void setObjectAmbientColor(int _objectId, Vector4 _color)
Definition: ColorPlugin.cc:315
ColorPlugin::optionsWidget_
ColorOptions * optionsWidget_
the options widget to set colors
Definition: ColorPlugin.hh:125
ColorPlugin::initializeOptionsWidget
bool initializeOptionsWidget(QWidget *&_widget)
generate an optionsWidget to change color presets
Definition: ColorPlugin.cc:457
ColorOptions
Definition: ColorOptions.hh:49
PluginFunctions::setBackColor
void setBackColor(OpenMesh::Vec4f _color)
Set the background color of the examiner widget.
Definition: PluginFunctions.cc:377
INIFile
Class for the handling of simple configuration files.
Definition: INIFile.hh:99
OpenMesh::Vec4f
VectorT< float, 4 > Vec4f
Definition: Vector11T.hh:850
ACG::SceneGraph::MaterialNode::set_base_color
void set_base_color(const Vec4f &_c)
set the base color ( Same as set_emission(const Vec4f& _c) )
Definition: MaterialNode.hh:421
ColorPlugin::backgroundColorPresentation_
OpenMesh::Vec4f backgroundColorPresentation_
the options widget to set colors
Definition: ColorPlugin.hh:146
ColorPlugin::materialColorPaper_
OpenMesh::Vec4f materialColorPaper_
the options widget to set colors
Definition: ColorPlugin.hh:148
ColorPlugin::setObjectDiffuseColor
void setObjectDiffuseColor(int _objectId, Vector4 _color)
Definition: ColorPlugin.cc:332
INIFile::section_exists
bool section_exists(const QString &_section) const
Check if given section exists in the current INI file.
Definition: INIFile.cc:227
ColorPlugin::baseColorPaper_
OpenMesh::Vec4f baseColorPaper_
the options widget to set colors
Definition: ColorPlugin.hh:147
ColorPlugin::setPresentationColor
void setPresentationColor()
Set the presentation color preset.
Definition: ColorPlugin.cc:183
ColorPlugin::lineWidthDefault_
double lineWidthDefault_
the options widget to set colors
Definition: ColorPlugin.hh:150