Developer Documentation
Loading...
Searching...
No Matches
ColorPlugin Class Reference
Inheritance diagram for ColorPlugin:
PythonInterface INIInterface OptionsInterface StatusbarInterface ToolbarInterface ScriptInterface MenuInterface BaseInterface

Public Slots

Scriptable functions to set colors
void setDefaultColor ()
 set the defaultColor preset
 
void setPresentationColor ()
 Set the presentation color preset.
 
void setPaperColor ()
 set the paperColor Preset
 
void setBackgroundColor (Vector _color)
 Set the backgroundColor.
 
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.
 
virtual void setSlotDescription (QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
 Set a description for a public slot.
 
virtual void setRenderer (unsigned int _viewer, QString _rendererName)
 Set a renderer for the given viewer.
 
- 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.
 
- Signals inherited from ScriptInterface
virtual void scriptInfo (QString _functionWithParameters)
 Emit this signal if a scriptable function is executed.
 
virtual void getScriptingEngine (QScriptEngine *&_engine)
 
virtual void executeFileScript (QString _filename)
 
virtual void getAvailableFunctions (QStringList &_functions)
 
- Signals inherited from ToolbarInterface
virtual void addToolbar (QToolBar *_toolbar)
 Adds a Toolbar to the main widget.
 
- Signals inherited from StatusbarInterface
virtual void showStatusMessage (QString _message, int _timeout=0)
 Show a message in the status bar.
 
- Signals inherited from PythonInterface
virtual void executePythonScript (QString _script)
 

Public Member Functions

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

Private Slots

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

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
 
QIcon generateIcon (QColor _color)
 generate an icon from a given color
 
QIcon generateIcon (OpenMesh::Vec4f _color)
 generate an icon from a given color
 
QRgb getIconColor (QIcon _icon)
 get the color from a given icon
 
void setNewColor (QIcon _icon, OpenMesh::Vec4f &_color)
 set the color of a color vector to the one in the given icon
 
void convertColor (uint _color, OpenMesh::Vec4f &_vector)
 convert betweeen uint and Vec4f
 
uint convertColor (OpenMesh::Vec4f &_vector)
 convert betweeen uint and Vec4f
 

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.
 
virtual void updatedObject (int _objectId)
 An object has been changed or added by this plugin.
 
virtual void updatedObject (int _identifier, const UpdateType &_type)
 An object has been changed or added by this plugin.
 
virtual void nodeVisibilityChanged (int _identifier)
 A scenegraph node has been shown or hidden.
 
virtual void getCurrentRenderer (unsigned int _viewer, QString &_rendererName)
 Get the current renderer for the given viewer.
 
- Private Member Functions inherited from MenuInterface
virtual ~MenuInterface ()
 Destructor.
 
virtual void addMenubarAction (QAction *_action, QString _name)
 Adds an action to the menubar.
 
virtual void addMenubarActions (std::vector< QAction * > &_actions, QString _name)
 Add multiple actions to the menu bar.
 
- Private Member Functions inherited from ScriptInterface
virtual ~ScriptInterface ()
 Destructor.
 
virtual void showScriptInEditor (QString _filename)
 
virtual void executeScript (QString _script)
 
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.
 
virtual void getToolBar (QString _name, QToolBar *&_toolbar)
 Get a pointer to a Toolbar of the given name or 0 if it does not exist.
 
- Private Member Functions inherited from StatusbarInterface
virtual ~StatusbarInterface ()
 Destructor.
 
virtual void setStatus (ApplicationStatus::applicationStatus _status)
 Sets the status icon of the StatusBar.
 
virtual void clearStatusMessage ()
 Removes the current message from the statusBar.
 
virtual void addWidgetToStatusbar (QWidget *_widget)
 Add a widget on the right side of the statusBar.
 
- Private Member Functions inherited from OptionsInterface
virtual ~OptionsInterface ()
 Destructor.
 
virtual void applyOptions ()=0
 Apply changes to options.
 
- Private Member Functions inherited from INIInterface
virtual ~INIInterface ()
 Destructor.
 
- Private Member Functions inherited from PythonInterface
virtual void openPythonScriptInEditor (QString _script)
 
virtual ~PythonInterface ()
 Destructor.
 

Detailed Description

Definition at line 62 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 503 of file ColorPlugin.cc.

◆ convertColor() [1/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 549 of file ColorPlugin.cc.

◆ convertColor() [2/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 530 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 114 of file ColorPlugin.hh.

◆ generateIcon() [1/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.

◆ generateIcon() [2/2]

QIcon ColorPlugin::generateIcon ( QColor  _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.

◆ 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 431 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 401 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 455 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 564 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 113 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 610 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 416 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 218 of file ColorPlugin.hh.

Member Data Documentation

◆ backgroundColorDefault_

OpenMesh::Vec4f ColorPlugin::backgroundColorDefault_
private

the options widget to set colors

Definition at line 148 of file ColorPlugin.hh.

◆ backgroundColorPaper_

OpenMesh::Vec4f ColorPlugin::backgroundColorPaper_
private

the options widget to set colors

Definition at line 148 of file ColorPlugin.hh.

◆ backgroundColorPresentation_

OpenMesh::Vec4f ColorPlugin::backgroundColorPresentation_
private

the options widget to set colors

Definition at line 148 of file ColorPlugin.hh.

◆ baseColorDefault_

OpenMesh::Vec4f ColorPlugin::baseColorDefault_
private

the options widget to set colors

Definition at line 149 of file ColorPlugin.hh.

◆ baseColorPaper_

OpenMesh::Vec4f ColorPlugin::baseColorPaper_
private

the options widget to set colors

Definition at line 149 of file ColorPlugin.hh.

◆ baseColorPresentation_

OpenMesh::Vec4f ColorPlugin::baseColorPresentation_
private

the options widget to set colors

Definition at line 149 of file ColorPlugin.hh.

◆ lineWidthDefault_

double ColorPlugin::lineWidthDefault_
private

the options widget to set colors

Definition at line 152 of file ColorPlugin.hh.

◆ lineWidthPaper_

double ColorPlugin::lineWidthPaper_
private

the options widget to set colors

Definition at line 152 of file ColorPlugin.hh.

◆ lineWidthPresentation_

double ColorPlugin::lineWidthPresentation_
private

the options widget to set colors

Definition at line 152 of file ColorPlugin.hh.

◆ materialColorDefault_

OpenMesh::Vec4f ColorPlugin::materialColorDefault_
private

the options widget to set colors

Definition at line 150 of file ColorPlugin.hh.

◆ materialColorPaper_

OpenMesh::Vec4f ColorPlugin::materialColorPaper_
private

the options widget to set colors

Definition at line 150 of file ColorPlugin.hh.

◆ materialColorPresentation_

OpenMesh::Vec4f ColorPlugin::materialColorPresentation_
private

the options widget to set colors

Definition at line 150 of file ColorPlugin.hh.

◆ optionsWidget_

ColorOptions* ColorPlugin::optionsWidget_
private

the options widget to set colors

Definition at line 127 of file ColorPlugin.hh.


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