Developer Documentation
ColorPlugin Class Reference
Inheritance diagram for ColorPlugin:
INIInterface OptionsInterface StatusbarInterface ToolbarInterface ScriptInterface MenuInterface BaseInterface

Public Slots

Scriptable functions to set colors
void setDefaultColor ()
 set the defaultColor preset More...
 
void setPresentationColor ()
 Set the presentation color preset. More...
 
void setPaperColor ()
 set the paperColor Preset More...
 
void setBackgroundColor (Vector _color)
 Set the backgroundColor. More...
 
void setObjectEmissiveColor (int _objectId, Vector4 _color)
 
void setObjectAmbientColor (int _objectId, Vector4 _color)
 
void setObjectDiffuseColor (int _objectId, Vector4 _color)
 
void setObjectSpecularColor (int _objectId, Vector4 _color)
 
Other scriptable functions
QString version ()
 

Signals

void updateView ()
 
void scriptInfo (QString _functionName)
 
void addMenubarAction (QAction *_action, QString _type)
 
void addToolbar (QToolBar *_toolbar)
 
void removeToolbar (QToolBar *_toolbar)
 
void showStatusMessage (QString _message, int _timeout=0)
 
- Signals inherited from BaseInterface
virtual void updateView ()
 Update current view in Main Application. More...
 
virtual void setSlotDescription (QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
 Set a description for a public slot. More...
 
virtual void setRenderer (unsigned int _viewer, QString _rendererName)
 Set a renderer for the given viewer. More...
 
- Signals inherited from MenuInterface
virtual void getMenubarMenu (QString _name, QMenu *&_menu, bool _create)
 Get a existing top level menu pointer or create a new one. More...
 
- Signals inherited from ScriptInterface
virtual void scriptInfo (QString _functionWithParameters)
 Emit this signal if a scriptable function is executed. More...
 
virtual void getScriptingEngine (QScriptEngine *&_engine)
 
virtual void executeScript (QString _script)
 
virtual void getAvailableFunctions (QStringList &_functions)
 
- Signals inherited from ToolbarInterface
virtual void addToolbar (QToolBar *_toolbar)
 Adds a Toolbar to the main widget. More...
 
- Signals inherited from StatusbarInterface
virtual void showStatusMessage (QString _message, int _timeout=0)
 Show a message in the status bar. More...
 

Public Member Functions

bool initializeOptionsWidget (QWidget *&_widget)
 generate an optionsWidget to change color presets More...
 
QString name ()
 Return a name for the plugin. More...
 
QString description ()
 Return a description of what the plugin is doing. More...
 
 ColorPlugin ()
 ConstructorOptionsInterface. More...
 

Private Slots

void pluginsInitialized ()
 initialize the toolbar and menubar More...
 
void applyOptions ()
 Store the changed color presets when the apply Button was hit. More...
 
void loadIniFileOptions (INIFile &_ini)
 read color preset from ini file More...
 
void saveIniFileOptions (INIFile &_ini)
 Store current color preset to an ini file. More...
 
- Private Slots inherited from BaseInterface
virtual void exit ()
 
virtual QString version ()
 Return a version string for your plugin. More...
 

Show Colors in Options and Store them in INI files

ColorOptionsoptionsWidget_
 the options widget to set colors
 
OpenMesh::Vec4f backgroundColorDefault_
 the options widget to set colors
 
OpenMesh::Vec4f backgroundColorPaper_
 the options widget to set colors
 
OpenMesh::Vec4f backgroundColorPresentation_
 the options widget to set colors
 
OpenMesh::Vec4f baseColorDefault_
 the options widget to set colors
 
OpenMesh::Vec4f baseColorPaper_
 the options widget to set colors
 
OpenMesh::Vec4f baseColorPresentation_
 the options widget to set colors
 
OpenMesh::Vec4f materialColorDefault_
 the options widget to set colors
 
OpenMesh::Vec4f materialColorPaper_
 the options widget to set colors
 
OpenMesh::Vec4f materialColorPresentation_
 the options widget to set colors
 
double lineWidthDefault_
 the options widget to set colors
 
double lineWidthPaper_
 the options widget to set colors
 
double lineWidthPresentation_
 the options widget to set colors
 
void getColorDialog ()
 display a color dialog More...
 
QIcon generateIcon (QRgb _color)
 generate an icon from a given color More...
 
QIcon generateIcon (OpenMesh::Vec4f _color)
 generate an icon from a given color More...
 
QRgb getIconColor (QIcon _icon)
 get the color from a given icon More...
 
void setNewColor (QIcon _icon, OpenMesh::Vec4f &_color)
 set the color of a color vector to the one in the given icon More...
 
void convertColor (uint _color, OpenMesh::Vec4f &_vector)
 convert betweeen uint and Vec4f More...
 
uint convertColor (OpenMesh::Vec4f &_vector)
 convert betweeen uint and Vec4f More...
 

Additional Inherited Members

- Private Member Functions inherited from BaseInterface
virtual void noguiSupported ()
 
virtual ~BaseInterface ()
 Destructor.
 
virtual void blockScenegraphUpdates (bool _block)
 Tell the core to prevent scenegraph updates. More...
 
virtual void updatedObject (int _objectId)
 An object has been changed or added by this plugin. More...
 
virtual void updatedObject (int _identifier, const UpdateType &_type)
 An object has been changed or added by this plugin. More...
 
virtual void nodeVisibilityChanged (int _identifier)
 A scenegraph node has been shown or hidden. More...
 
virtual void getCurrentRenderer (unsigned int _viewer, QString &_rendererName)
 Get the current renderer for the given viewer. More...
 
- Private Member Functions inherited from MenuInterface
virtual ~MenuInterface ()
 Destructor.
 
virtual void addMenubarAction (QAction *_action, QString _name)
 Adds an action to the menubar. More...
 
virtual void addMenubarActions (std::vector< QAction *> &_actions, QString _name)
 Add multiple actions to the menu bar. More...
 
- Private Member Functions inherited from ScriptInterface
virtual ~ScriptInterface ()
 Destructor.
 
virtual void executeFileScript (QString _filename)
 
virtual void getDescription (QString _function, QString &_description, QStringList &_parameters, QStringList &_descriptions)
 
- Private Member Functions inherited from ToolbarInterface
virtual ~ToolbarInterface ()
 Destructor.
 
virtual void removeToolbar (QToolBar *_toolbar)
 Remove a Toolbar from the main widget. More...
 
virtual void getToolBar (QString _name, QToolBar *&_toolbar)
 Get a pointer to a Toolbar of the given name or 0 if it does not exist. More...
 
- Private Member Functions inherited from StatusbarInterface
virtual ~StatusbarInterface ()
 Destructor.
 
void setStatus (ApplicationStatus::applicationStatus _status)
 Sets the status icon of the StatusBar. More...
 
void clearStatusMessage ()
 Removes the current message from the statusBar. More...
 
void addWidgetToStatusbar (QWidget *_widget)
 Add a widget on the right side of the statusBar. More...
 
- Private Member Functions inherited from OptionsInterface
virtual ~OptionsInterface ()
 Destructor.
 
virtual void applyOptions ()=0
 Apply changes to options. More...
 
- Private Member Functions inherited from INIInterface
virtual ~INIInterface ()
 Destructor.
 

Detailed Description

Definition at line 61 of file ColorPlugin.hh.

Constructor & Destructor Documentation

◆ ColorPlugin()

ColorPlugin::ColorPlugin ( )

ConstructorOptionsInterface.

Constructor.

Definition at line 56 of file ColorPlugin.cc.

Member Function Documentation

◆ applyOptions

void ColorPlugin::applyOptions ( )
privateslot

Store the changed color presets when the apply Button was hit.

Definition at line 505 of file ColorPlugin.cc.

◆ convertColor() [1/2]

void ColorPlugin::convertColor ( uint  _color,
OpenMesh::Vec4f _vector 
)
private

convert betweeen uint and Vec4f

convert between uint and Vec4f

Parameters
_colorgiven color
_vectorcolor vector to convert to

Definition at line 532 of file ColorPlugin.cc.

◆ convertColor() [2/2]

uint ColorPlugin::convertColor ( OpenMesh::Vec4f _vector)
private

convert betweeen uint and Vec4f

convert between uint and Vec4f

Parameters
_vectorreference to a color vector
Returns
same color as uint

Definition at line 551 of file ColorPlugin.cc.

◆ description()

QString ColorPlugin::description ( )
inlinevirtual

Return a description of what the plugin is doing.

This function has to return a basic description of the plugin

Implements BaseInterface.

Definition at line 112 of file ColorPlugin.hh.

◆ generateIcon() [1/2]

QIcon ColorPlugin::generateIcon ( QRgb  _color)
private

generate an icon from a given color

Generate an icon with given color.

Parameters
_colora color
Returns
the icon

Definition at line 385 of file ColorPlugin.cc.

◆ generateIcon() [2/2]

QIcon ColorPlugin::generateIcon ( OpenMesh::Vec4f  _color)
private

generate an icon from a given color

Generate an icon with given color.

Parameters
_colora color vector
Returns
an icon

Definition at line 366 of file ColorPlugin.cc.

◆ getColorDialog

void ColorPlugin::getColorDialog ( )
privateslot

display a color dialog

show a colorDialog and store the chosen value in the icon of the sender()

Definition at line 433 of file ColorPlugin.cc.

◆ getIconColor()

QRgb ColorPlugin::getIconColor ( QIcon  _icon)
private

get the color from a given icon

Get the color of an icon.

Parameters
_iconan icon
Returns
its color

Definition at line 403 of file ColorPlugin.cc.

◆ initializeOptionsWidget()

bool ColorPlugin::initializeOptionsWidget ( QWidget *&  _widget)
virtual

generate an optionsWidget to change color presets

Parameters
_widgetreference to the generated widget
Returns
return true if the widget was successfully generated

Implements OptionsInterface.

Definition at line 457 of file ColorPlugin.cc.

◆ loadIniFileOptions

void ColorPlugin::loadIniFileOptions ( INIFile _ini)
privateslot

read color preset from ini file

Parameters
_inifile to read from

Definition at line 566 of file ColorPlugin.cc.

◆ name()

QString ColorPlugin::name ( )
inlinevirtual

Return a name for the plugin.

This Function has to return the name of the plugin.

Implements BaseInterface.

Definition at line 111 of file ColorPlugin.hh.

◆ pluginsInitialized

void ColorPlugin::pluginsInitialized ( )
privateslot

initialize the toolbar and menubar

Definition at line 83 of file ColorPlugin.cc.

◆ saveIniFileOptions

void ColorPlugin::saveIniFileOptions ( INIFile _ini)
privateslot

Store current color preset to an ini file.

Parameters
_inifile to store color presets in

Definition at line 612 of file ColorPlugin.cc.

◆ setBackgroundColor

void ColorPlugin::setBackgroundColor ( Vector  _color)
slot

Set the backgroundColor.

Sets the background color of the scene

Parameters
_colora color

Definition at line 276 of file ColorPlugin.cc.

◆ setDefaultColor

void ColorPlugin::setDefaultColor ( )
slot

set the defaultColor preset

Applies Default colors to the whole scene

Definition at line 137 of file ColorPlugin.cc.

◆ setNewColor()

void ColorPlugin::setNewColor ( QIcon  _icon,
OpenMesh::Vec4f _color 
)
private

set the color of a color vector to the one in the given icon

convert an icons color to a Vec4f

Parameters
_iconan icon
_colorreference to a color vector

Definition at line 418 of file ColorPlugin.cc.

◆ setObjectAmbientColor

void ColorPlugin::setObjectAmbientColor ( int  _objectId,
Vector4  _color 
)
slot

Sets the ambient color of an object

Sets the ambient color of an object

Parameters
_objectIdId of an Object
_colorColor to be set

Definition at line 315 of file ColorPlugin.cc.

◆ setObjectDiffuseColor

void ColorPlugin::setObjectDiffuseColor ( int  _objectId,
Vector4  _color 
)
slot

Sets the diffuse color of an object

Sets the diffuse color of an object

Parameters
_objectIdId of an Object
_colorColor to be set

Definition at line 332 of file ColorPlugin.cc.

◆ setObjectEmissiveColor

void ColorPlugin::setObjectEmissiveColor ( int  _objectId,
Vector4  _color 
)
slot

Sets the emissive color of an object

Sets the emissive color of an object

Parameters
_objectIdId of an Object
_colorColor to be set

Definition at line 296 of file ColorPlugin.cc.

◆ setObjectSpecularColor

void ColorPlugin::setObjectSpecularColor ( int  _objectId,
Vector4  _color 
)
slot

Sets the specular color of an object

Sets the specular color of an object

Parameters
_objectIdId of an Object
_colorColor to be set

Definition at line 349 of file ColorPlugin.cc.

◆ setPaperColor

void ColorPlugin::setPaperColor ( )
slot

set the paperColor Preset

Applies colors for papers

Definition at line 229 of file ColorPlugin.cc.

◆ setPresentationColor

void ColorPlugin::setPresentationColor ( )
slot

Set the presentation color preset.

Applies colors for presentations to the scene

Definition at line 183 of file ColorPlugin.cc.

◆ version

QString ColorPlugin::version ( )
inlineslot

Version info of the color plugin

Definition at line 216 of file ColorPlugin.hh.


The documentation for this class was generated from the following files: