Core Class Reference

#include <Core.hh>

Collaboration diagram for Core:
Collaboration graph
[legend]

List of all members.

Public Slots

scriptable slots

Get a Pointer to the Plugin with given _name (if it is loaded)



void updateView ()
 Called when a plugin requests an update in the viewer.
void clearAll ()
 Clear all data objects.
void exitApplication ()
 exit the current application
void fullscreen (bool _state)
 set fullscreen mode
void loggerState (int _state)
 Change the logging window state.
void showToolbox (bool _state)
 Show or hide toolbox.
void multiViewMode (int _mode)
 Switch the multiView Mode.
void restrictFrameRate (bool _enable)
 Enable or disable framerate restriction.
void setMaxFrameRate (int _rate)
 set the maximal framerate ( automatically enables framerate restriction )
void snapshotBaseFileName (const QString &_fname, unsigned int _viewerId=0)
void snapshot (unsigned int _viewerId=0)
void applicationSnapshot ()
 Take a snapshot from the whole app.
void applicationSnapshotName (QString _name)
 Set the baseName for the application snapshot.
void viewerSnapshot ()
 Take a snapshot from all viewers.
void resizeViewers (int _width, int _height)
 resize the examinerViewer
void resizeApplication (int _width, int _height)
 resize the whole Application
void writeVersionNumbers (QString _filename)
 write the current versions of all plugins to ini file
QList< int > objectList (QString _selection, QStringList _types)
 return the list of available object that has the given selection and type
Scripting functions for controlling view modes



void addViewModeToolboxes (QString _modeName, QString _toolboxList)
 Scripting function to set toolboxes in a view mode.
void addViewModeToolbars (QString _modeName, QString _toolbarList)
 Scripting function to set toolbars in a view mode.
Load / Save slots



bool saveObject (int _id, QString _filename)
bool saveObjectTo (int _id, QString _filename)
void saveAllObjects ()
 Slot for saving objects from Menu.
void saveAllObjectsTo ()
 Slot for saving objects to a new location.
void saveSettings ()
 Save current status to a settings file.
void loadObject ()
 Open Load Widget.
void loadSettings ()
 Load status from file.
void loadSettings (QString _filename)
 Load status from file.
int getObjectId (QString _filename)
 Get object id from filename.

Signals

Signals send to Plugins



void allCleared ()
 Signal send to plugins when whole scene is cleared.
void signalObjectUpdated (int)
 When this Signal is emitted all Plugins are informed that the object list changed.
void PluginWheelEvent (QWheelEvent *, const std::string &)
 When this Signal is emitted when a Wheel Event occures.
void PluginMouseEvent (QMouseEvent *)
 When this Signal is emitted when a Mouse Event occures.
void PluginMouseEventIdentify (QMouseEvent *)
 Emitted when an identify event occurs.
void objectSelectionChanged (int)
 This signal is emitted if the object has been changed (source/target).
void pluginViewChanged ()
 This signal is emitted if one of the viewers updated its view.
void addTexture (QString, QString, uint, int)
 The texture with the given name and filename has been added.
void addTexture (QString, QString, uint)
 The texture with the given name and filename has been added.
void addMultiTexture (QString _textureGroup, QString _name, QString _filename, int _id, int &_textureId)
 The texture with the given name and filename has been added.
void updateTexture (QString, int)
 Tell the plugins to update the given texture.
void updateAllTextures ()
 Update all textures in the plugins.
void updatedTextures (QString, int)
 This Signal is send to the plugins if a texture has been updated.
void setTextureMode (QString _textureName, QString _mode, int _id)
 A texture mode should be changed.
void setTextureMode (QString _textureName, QString _mode)
 A texture mode should be changed.
void switchTexture (QString, int)
 Switch Texture Plugins to a given Mode.
void switchTexture (QString)
 Switch Texture Plugins to a given Mode.
void textureChangeImage (QString _textureName, QImage &_image)
 Change the image for a given texture.
void textureChangeImage (QString _textureName, QImage &_image, int _id)
 Change the image for a given texture.
void iniLoad (INIFile &, int)
 If an ini File is opened, this signal is send to Plugins capable of handling ini files.
void iniSave (INIFile &_ini, int _id)
 This signal is used to tell the plugins to save the data of _id to the given file.
void iniSaveOptions (INIFile &_ini)
 This signal is used to tell the plugins to save their current status.
void iniLoadOptions (INIFile &_ini)
 This signal is used to tell the plugins to load their new status.
void iniLoadOptionsLast (INIFile &_ini)
 This signal is used to tell the plugins to load their new status after objects are loaded.
void saveOnExit (INIFile &_ini)
 This signal is emitted before the core deletes its data and exits.
void createBackup (int _id, QString _name, int nextBackupId_)
 Tell plugins to create a backup.
void openedFile (int _id)
 Tell the plugins that a file has been opened ( -> Database).
void emptyObjectAdded (int _id)
 Tell the plugins that an empty object has been added.
void pluginsInitialized ()
 Called after all plugins are loaded.
void visibilityChanged (int _id)
 Tell plugins that the visibility of an object has changed.
void objectPropertiesChanged (int _id)
 Tell plugins that object properties such as object names have been changed.
void objectDeleted (int)
 Called after an object has been deleted.

Public Member Functions

 Core ()
 constructor
void init ()
 Second initialization stage.
 ~Core ()
 destructor
bool add_sync_host (const QString &_name)
 Synchronise two viewers.

Private Slots

void slotMouseEventIdentify (QMouseEvent *_event)
 Handle Mouse events when in Identifier mode.
Slots called by the plugins



void slotObjectUpdated (int _identifier)
void slotVisibilityChanged (int _id)
 Called when a plugin changes the visibility of an object.
void slotObjectPropertiesChanged (int _id)
 Called by plugins if object properties like names have changed.
void slotObjectSelectionChanged (int _id)
 Called by Plugins if they changed the active object.
void slotAddPickMode (const std::string _mode)
 Add a new picking mode to the examiner_widget_.
void slotAddHiddenPickMode (const std::string _mode)
 Add a new and invisible picking mode to the examiner_widget_.
void slotAddTexture (QString _textureName, QString _filename, uint _dimension, int _id)
 Called by a plugin if it creates a texture.
void slotAddTexture (QString _textureName, QString _filename, uint _dimension)
 Called by a plugin if it creates a texture.
void slotMultiTextureAdded (QString _textureGroup, QString _name, QString _filename, int _id, int &_textureId)
 Called by a plugin if it creates a multitexture.
void slotUpdateTexture (QString _name, int _identifier)
 Tell the plugins to update the given texture.
void slotUpdateAllTextures ()
 Update all textures in the plugins.
void slotTextureUpdated (QString _textureName, int _identifier)
 A Texture has been updated.
void slotSetTextureMode (QString _textureName, QString _mode, int _id)
 A texture mode should be changed.
void slotSetTextureMode (QString _textureName, QString _mode)
 A texture mode should be changed.
void slotSwitchTexture (QString _textureName, int _id)
 Tells Plugins to switch to the given Texture.
void slotSwitchTexture (QString _textureName)
 Tells Plugins to switch to the given Texture.
void slotTextureChangeImage (QString _textureName, QImage &_image)
 Called by plugins if texture image should be changed.
void slotTextureChangeImage (QString _textureName, QImage &_image, int _id)
 Called by plugins if texture image should be changed.
void backupRequest (int _id, QString _name)
 Called if a backup is requested by the plugins.
void slotLoad (QString _filename, DataType _type, int &_id)
 A plugin wants to load a given file.
void slotObjectOpened (int _id)
 Called when a file has been opened.
void slotEmptyObjectAdded (int _id)
 Called when an empty object has been Added.
void slotGetAllFilters (QStringList &_list)
 Called when a plugin requests a list of file-filters.
void slotDeleteObject (int _id)
 Called when a plugin wants to delete an object.
void slotDeleteAllObjects ()
 Called when a plugin wants to delete all objects.
RPC ( Remote procedure Call) support



void slotPluginExists (QString _pluginName, bool &_exists)
void slotFunctionExists (QString _pluginName, QString _functionName, bool &_exists)
void slotCall (QString _pluginName, QString _functionName, bool &_success)
void slotCall (QString _expression, bool &_success)
void slotGetValue (QString _expression, QVariant &_result)

Private Member Functions

Signal and Slot processing for Plugins



bool checkSlot (QObject *_plugin, const char *_slotSignature)
 Check if a plugin has a slot.
bool checkSignal (QObject *_plugin, const char *_signalSignature)
 Check if a plugin has a signal.

Private Attributes

int nextBackupId_
 Id for the next backup.
std::vector< PluginLogger * > loggers_
 Logger interfaces between plugins and core logger.
std::vector< fileTypessupportedTypes_
 File-Plugins.
BaseObjectobjectRoot_
 addEmpty Widget
CoreWidgetcoreWidget_
 The main applications widget ( only created in gui mode ).
QSplashScreen * splash_
 SplashScreen, only used in gui mode.
QString splashMessage_
 Last Splash message;.
QVector< ViewMode * > viewModes_
 List of available draw modes.
QTimer * redrawTimer_
 If enabled, this timer will block screen refresh if done more then 30 times per second.
Scenegraph



SeparatorNoderoot_node_scenegraph_
 Scenegraphs root node.
SeparatorNodecore_nodes_
 Separator Node holding all core scenegraph nodes.
SeparatorNodedataSeparatorNode_
 Toplevel Nodes for data objects.
SeparatorNodedataRootNode_
 Root Node for data objects.
ACG::SceneGraph::MaterialNodecoordsysMaterialNode_
 Node for coordsys Material.
ACG::SceneGraph::CoordsysNodecoordsysNode_
 Node for the coordinate system.

Basic functions



std::vector< std::pair
< std::string, bool > > 
commandLineFileNames_
std::vector< std::string > commandLineScriptNames_
void commandLineOpen (const char *_filename, bool asPolyMesh)
 Load an object from the commandline on application start.
void commandLineScript (const char *_filename)
 Execute a script from the command Line.
int addEmptyObject (DataType _type)
 Function for adding an empty object of given DataType.
int loadObject (DataType _type, QString _filename)
 Function for loading a given file.
void slotExecuteAfterStartup ()
 Executed after loading core completly.
int loadObject (QString _filename)
 Load object by guessing DataType depending on the files extension.
void resetScenegraph (bool _resetTrackBall)

Video Stream creation



QTimer videoTimer_
QTime lastVideoTime_
int captureType_
bool capture_
int lastWidth_
int lastHeight_
void viewUpdated ()
 Slot called everytime the view is updated.
void captureVideo ()
 Function called for every frame when capturing video.
void startVideoCapture (QString _baseName, int _fps, bool _captureViewers)
 Start video capturing.
void stopVideoCapture ()
 Stop video capturing.

Logging



QTextStream * logStream_
 stream for logging to file
QFile * logFile_
 logfile
void scriptLogFunction (QString _output)
void slotLog (Logtype _type, QString _message)
 Console logger.
void slotLogToFile (Logtype _type, QString _message)
 log to file
void log (Logtype _type, QString _message)
 Logg with OUT,WARN or ERR as type.
void log (QString _message)
 Default logging as OUT.
void scriptLog (QString _message)
 Logging signal for ScriptEngine.
void externalLog (Logtype _type, QString _message)
 This signal is emitted to send log data to a plugin.

Plugin Management



std::vector< PluginInfoplugins
 List of all loaded plugins.
QStringList dontLoadPlugins_
 List of Plugins that should not be loaded.
int toolboxindex_
 Index of Plugins toolbox widget.
void slotShowPlugins ()
 Show Plugins Dialog.
void unloadPlugin (QString name)
 Function for unloading Plugins.
void dontLoadPlugins (QStringList _plugins)
 Dont Load the given _plugins on next startup.
void slotLoadPlugin ()
 Load Plugins from menu.
void loadPlugin (QString filename, bool silent)
 Function for loading Plugins.
void loadPlugins ()
 Load all plugins from default plugin directory and from INI-File.

Scripting support



QScriptEngine scriptEngine_
 Core scripting engine.
std::vector< ScriptingWrapper * > scriptingWrappers_
 Wrappers for plugin scripting.
QStringList scriptingFunctions_
 List of all registered scripting functions.
prototypeVec3d vec3dPrototype_
 Prototype for the Vector type.
prototypeMatrix4x4 matrix4x4Prototype_
 Prototype for the Vector type.
QList< SlotInfocoreSlots_
void slotScriptInfo (QString _pluginName, QString _functionName)
void slotExecuteScript (QString _script)
void slotGetScriptingEngine (QScriptEngine *&_engine)
void slotGetAllAvailableFunctions (QStringList &_functions)
void slotSetSlotDescription (QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
 set a description for one of the plugin's public slots
void slotGetDescription (QString _function, QString &_fnDescription, QStringList &_parameters, QStringList &_descriptions)
 get available descriptions for a given public slot
void scriptInfo (QString _pluginName, QString _functionName)
void executeScript (QString _script)
void executeFileScript (QString _filename)
void setSlotDescription (QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
void createWidget (QString _objectName, QString _uiFilename)
 Create an script object from a ui file.
void setViewMode (QString _viewMode)
 Set the active ViewMode.
void setDescriptions ()
 set the descriptions for scriptable slots of the core

Scenegraph redraw handling



QTimer * scenegraphCheckTimer_
 Timer that starts scenegraph check.
QTime * redrawTime_
 Holds the time since last redraw.
void checkScenegraphDirty ()
 Called to check if the scenegraph needs to be redrawn.

Process Interface and Controls



QList< JobInfo * > currentJobs
void slotStartJob (QString _jobId, QString _description, int _min, int _max, bool _blocking)
 A job has been started by a plugin.
void slotSetJobState (QString _jobId, int _value)
 A job state has been updated by a plugin.
void slotCancelJob (QString _jobId)
 A job state has been canceled by a plugin.
void slotFinishJob (QString _jobId)
 A job state has been finished by a plugin.
void slotJobCancelButtons ()
 Called by dialogs if cancel button is pressed.
void jobCanceled (QString _jobId)
bool getJob (QString _jobId, int &_index)
 Find a job in the jobslist.

Basic slots



void slotMouseEvent (QMouseEvent *_event)
 Gets called by examiner widget when mouse is moved in picking mode.
void slotWheelEvent (QWheelEvent *_event, const std::string &_mode)
 Gets called by examiner widget when Wheel is moved in picking mode.
void slotAddEmptyObjectMenu ()
 Slot adding empty object from Menu.
void slotAddEmptyObject (DataType _type, int &_id)
 Slot adding empty object of a given type.
void slotCopyObject (int _oldId, int &_newId)
 Slot copying an object.
void slotExit ()
 Exit Application.
void slotRecentOpen (QAction *_action)
 Open Recent file.
void addToolbox (QString _name, QWidget *_widget)
 Add a Toolbox from a plugin or from scripting.

IniFile and Options Handling

Node for the grid



void saveOptions ()
 Save the current options to the standard ini file.
void applyOptions ()
 after ini-files have been loaded and core is up or if options have been changed -> apply Options
void openIniFile (QString _filename, bool _coreSettings, bool _perPluginSettings, bool _loadObjects)
 Load information from an ini file.
void openObjFile (QString _filename)
 Open an obj file and load everything in it ( Application/File Options ).
void preprocessObjFile (QString _filename)
 Preprocesses obj file to find out which data type it stores.
void setupOptions ()
 Get all ini files and set basic paths and options.
void readGUIOptions (INIFile &_ini)
 Read Options that needs the GUI to be set up completely.
void readRecentFiles (QString _filename)
 Read recent files from ini-file.
void readApplicationOptions (INIFile &_ini)
 Get and set Application options from ini file.
void writeApplicationOptions (INIFile &_ini)
 Write Application options to ini file.
void restoreKeyBindings ()
 Restore key assignments from configs files.
void writeIniFile (QString _filename, bool _relativePaths, bool _targetOnly, bool _saveSystemSettings, bool _savePluginSettings, bool _saveObjectInfo)
 Write current status to ini file (Application and File Options).
void writeObjFile (QString _filename, bool _relativePaths, bool _targetOnly)
 Write current status to obj file (Application and File Options).
void writeOnExit ()
 Called if app is closed and writes all information to ini file.

Detailed Description

Core Widget of the Application

Definition at line 122 of file Core.hh.


Constructor & Destructor Documentation

Core::Core (  ) 

constructor

Constuctor for the Core Widget ( This is stage 1 , call init for stage 2).

Initialization is working the following way:

  • Setup basic paths
  • Get Options from Option files ( While skipping the OpenFiles Sections as Core is not running )
  • Jump back ( Stage two is done by calling init from main ) so CALL init!!
  • This Two stage system allows using commandline options which override Option Files

Definition at line 117 of file Core.cc.

References coordsysMaterialNode_, coordsysNode_, core_nodes_, ViewMode::custom, dataRootNode_, dataSeparatorNode_, ViewMode::icon, logFile_, logStream_, ViewMode::name, ACG::SceneGraph::BaseNode::NodeFirst, root_node_scenegraph_, ACG::SceneGraph::BaseNode::SecondPass, setDescriptions(), ACG::SceneGraph::BaseNode::setTraverseMode(), setupOptions(), PluginFunctions::setViewerProperties(), Viewer::ViewerProperties::snapshotBaseFileName(), viewModes_, and ViewMode::visibleToolboxes.


Member Function Documentation

int Core::addEmptyObject ( DataType  _type  ) 

Function for adding an empty object of given DataType.

Add an empty Object of the given Type

Returns:
id of the new object or -1 if unsupported

Definition at line 218 of file openFunctions.cc.

References supportedTypes_.

Referenced by loadPlugin(), and slotAddEmptyObject().

void Core::addViewModeToolbars ( QString  _modeName,
QString  _toolbarList 
) [slot]

Scripting function to set toolbars in a view mode.

Parameters:
_modeName Name of the View Mode
_toolboxList ; seperated list of toolbars in the view mode

Definition at line 141 of file scripting.cc.

References coreWidget_, and CoreWidget::slotAddViewModeToolbars().

void Core::addViewModeToolboxes ( QString  _modeName,
QString  _toolboxList 
) [slot]

Scripting function to set toolboxes in a view mode.

Parameters:
_modeName Name of the View Mode
_toolboxList ; seperated list of toolboxes in the view mode

Definition at line 133 of file scripting.cc.

References coreWidget_, and CoreWidget::slotAddViewModeToolboxes().

void Core::checkScenegraphDirty (  )  [private, slot]

Called to check if the scenegraph needs to be redrawn.

Check if scenegraph is dirty and initiate redraw

Definition at line 769 of file Core.cc.

References root_node_scenegraph_, ACG::SceneGraph::traverse(), and updateView().

Referenced by init().

void Core::createWidget ( QString  _objectName,
QString  _uiFilename 
) [slot]

Create an script object from a ui file.

This function will load an ui file, set up a qwidget from that and makes it available under _objectName for scripting.

Parameters:
_objectName The name in scripting environment used for the new object
_uiFilename ui file to load

Definition at line 83 of file scripting.cc.

References log(), and scriptEngine_.

void Core::dontLoadPlugins ( QStringList  _plugins  )  [private, slot]

Dont Load the given _plugins on next startup.

prevent OpenFlipper from loading plugins on the next start (slot)

Parameters:
_plugins semicolon separated string with plugin names

Definition at line 335 of file PluginLoader.cc.

References dontLoadPlugins_.

Referenced by slotShowPlugins().

void Core::init (  ) 

Second initialization stage.

This Stage does the following :

  • Create the Core GUI Elements (Examiner, Toolbox,...)
  • Create the MenuBar
  • load the Plugins
  • connect the Mouse slots
  • Load all ini files (This includes the Global Option files)

Skip all signals for function calls

Definition at line 196 of file Core.cc.

References applyOptions(), checkScenegraphDirty(), checkSignal(), clearAll(), coreWidget_, dataSeparatorNode_, CoreWidget::examiner_widgets_, loadObject(), loadPlugins(), loadSettings(), log(), loggers_, matrix4x4Prototype_, myPrintFunction(), objectRoot_, openIniFile(), plugins, pluginViewChanged(), readRecentFiles(), redrawTime_, redrawTimer_, resizeApplication(), resizeViewers(), restoreKeyBindings(), SideArea::restoreState(), QtSlideWindow::restoreState(), root_node_scenegraph_, saveAllObjects(), saveAllObjectsTo(), saveOptions(), saveSettings(), scenegraphCheckTimer_, scriptEngine_, scriptingFunctions_, scriptLog(), PluginFunctions::setDataRoot(), PluginFunctions::setDataSeparatorNodes(), PluginFunctions::setSceneGraphRootNode(), RPC::setScriptEngine(), CoreWidget::setViewMode(), CoreWidget::slidingLogger_, slotAddEmptyObjectMenu(), slotCall(), slotExecuteAfterStartup(), slotExit(), slotLog(), slotLogToFile(), slotMouseEvent(), slotMouseEventIdentify(), slotRecentOpen(), CoreWidget::slotRegisterSlotKeyBindings(), slotShowPlugins(), slotWheelEvent(), splash_, CoreWidget::splitter_, startVideoCapture(), stopVideoCapture(), CoreWidget::toolBox_, CoreWidget::toolSplitter_, CoreWidget::updateRecent(), updateView(), vec3dPrototype_, viewModes_, and viewUpdated().

void Core::loadObject (  )  [slot]

Open Load Widget.

Open Load-Object Widget.

Definition at line 496 of file openFunctions.cc.

References log(), saveObject(), LoadWidget::showLoad(), slotLoad(), and supportedTypes_.

Referenced by init(), loadObject(), openIniFile(), preprocessObjFile(), slotExecuteAfterStartup(), slotLoad(), and slotRecentOpen().

int Core::loadObject ( DataType  _type,
QString  _filename 
)

Function for loading a given file.

Load object of the given Type with given filename

Returns:
id of the new object or -1 if unsupported

Definition at line 184 of file openFunctions.cc.

References coreWidget_, DATA_UNKNOWN, loadObject(), and supportedTypes_.

int Core::loadObject ( QString  _filename  )  [private]

Load object by guessing DataType depending on the files extension.

Load a new Object ( this may also be an ini file )

Parameters:
_filename Filename of the data
Returns:
id of object otherwise -1

Definition at line 162 of file openFunctions.cc.

References CoreWidget::addRecent(), coreWidget_, DATA_TRIANGLE_MESH, DATA_UNKNOWN, loadObject(), log(), and openIniFile().

void Core::loadPlugin ( QString  filename,
bool  silent 
) [private]

Function for loading Plugins.

Load a Plugin with given filename.

Parameters:
filename complete path + filename of the plugin
silent if 'true': user isn't asked what to do if a plugin is already loaded

Skip all signals for function calls

Definition at line 344 of file PluginLoader.cc.

References addEmptyObject(), addMultiTexture(), addTexture(), addToolbox(), allCleared(), applyOptions(), backupRequest(), checkSignal(), checkSlot(), coreWidget_, createBackup(), PluginInfo::description, BaseInterface::description(), dontLoadPlugins_, emptyObjectAdded(), externalLog(), FileInterface::getLoadFilters(), FileInterface::getSaveFilters(), iniLoad(), iniLoadOptions(), iniLoadOptionsLast(), iniSave(), iniSaveOptions(), OptionsInterface::initializeOptionsWidget(), log(), loggers_, PluginInfo::name, BaseInterface::name(), objectDeleted(), objectPropertiesChanged(), objectSelectionChanged(), openedFile(), PluginInfo::optionsWidget, PluginInfo::path, PluginInfo::plugin, PluginMouseEvent(), PluginMouseEventIdentify(), plugins, pluginsInitialized(), pluginViewChanged(), PluginWheelEvent(), PluginInfo::rpcFunctions, PluginInfo::rpcName, saveObject(), saveOnExit(), scriptEngine_, scriptingFunctions_, scriptingWrappers_, setTextureMode(), signalObjectUpdated(), slotAddEmptyObject(), slotAddHiddenPickMode(), slotAddPickMode(), slotAddTexture(), slotCall(), slotCancelJob(), slotCopyObject(), slotDeleteAllObjects(), slotDeleteObject(), slotEmptyObjectAdded(), slotFinishJob(), slotGetAllFilters(), slotGetDescription(), slotGetValue(), slotLoad(), slotLog(), slotLogToFile(), slotMouseEvent(), slotMouseEventIdentify(), slotMultiTextureAdded(), slotObjectOpened(), slotObjectPropertiesChanged(), slotObjectSelectionChanged(), slotObjectUpdated(), slotSetJobState(), slotSetSlotDescription(), slotSetTextureMode(), slotStartJob(), slotSwitchTexture(), slotTextureChangeImage(), slotTextureUpdated(), slotUpdateAllTextures(), slotUpdateTexture(), slotVisibilityChanged(), splash_, splashMessage_, FileInterface::supportedType(), supportedTypes_, switchTexture(), textureChangeImage(), unloadPlugin(), updateAllTextures(), updatedTextures(), updateTexture(), updateView(), BaseInterface::version(), PluginInfo::version, and visibilityChanged().

Referenced by loadPlugins(), slotLoadPlugin(), and slotShowPlugins().

void Core::loadPlugins (  )  [private]

Load all plugins from default plugin directory and from INI-File.

Load plugins from dir Plugins. The plugin information gets stored, toolbox and menu entries are created and the required signals and slots are connected.

Definition at line 115 of file PluginLoader.cc.

References INIFile::connect(), INIFile::disconnect(), dontLoadPlugins_, INIFile::get_entry(), loadPlugin(), log(), plugins, pluginsInitialized(), splash_, and splashMessage_.

Referenced by init().

void Core::loadSettings ( QString  _filename  )  [slot]

Load status from file.

Load settings from file.

Definition at line 604 of file openFunctions.cc.

References applyOptions(), openIniFile(), and openObjFile().

void Core::loadSettings (  )  [slot]

Load status from file.

Load settings from file.

Definition at line 519 of file openFunctions.cc.

References CoreWidget::addRecent(), applyOptions(), coreWidget_, DATA_UNKNOWN, openIniFile(), and openObjFile().

Referenced by init(), and slotRecentOpen().

void Core::openIniFile ( QString  _filename,
bool  _coreSettings,
bool  _perPluginSettings,
bool  _loadObjects 
) [slot]

Load information from an ini file.

This function will open an ini file and load the information in it.

Parameters:
_filename Name of the ini file
_coreSettings Load core settings from the file
_perPluginSettings Load per plugin settings from the file
_loadObjects Load objects defined in the ini file

Definition at line 692 of file ParseIni.cc.

References BaseObject::childExists(), INIFile::connect(), coreWidget_, DATA_TRIANGLE_MESH, INIFile::disconnect(), Viewer::ViewerProperties::drawMode(), CoreWidget::examiner_widgets_, INIFile::get_entry(), BaseObject::id(), iniLoad(), iniLoadOptions(), iniLoadOptionsLast(), loadObject(), log(), objectRoot_, objectSelectionChanged(), readApplicationOptions(), resetScenegraph(), INIFile::section_exists(), BaseObject::source(), BaseObject::target(), typeId(), typeName(), and PluginFunctions::viewerProperties().

Referenced by init(), loadObject(), and loadSettings().

void Core::readApplicationOptions ( INIFile _ini  )  [private]
void Core::resetScenegraph ( bool  _resetTrackBall  )  [private]

Do a reset of the scenegraph (bounding box update,...)

Parameters:
_resetTrackBall Should the rotation center of the trackball be reset to the scene center?

Definition at line 62 of file openFunctions.cc.

References coreWidget_, CoreWidget::examiner_widgets_, Viewer::ViewerProperties::lockUpdate(), root_node_scenegraph_, CoreWidget::slotUpdateGlobalDrawMenu(), Viewer::ViewerProperties::unLockUpdate(), and PluginFunctions::viewerProperties().

Referenced by openIniFile(), openObjFile(), slotObjectOpened(), slotObjectUpdated(), and slotVisibilityChanged().

void Core::restoreKeyBindings (  )  [private]

Restore key assignments from configs files.

restore key Assignments that were saved in config files

Definition at line 378 of file optionHandling.cc.

References INIFile::connect(), coreWidget_, INIFile::disconnect(), CoreWidget::loadKeyBindings(), and log().

Referenced by init().

void Core::saveAllObjects (  )  [slot]

Slot for saving objects from Menu.

Save changes for all target objects (slot is called from CoreWidget's File-Menu).

Definition at line 135 of file saveFunctions.cc.

References PluginFunctions::objectsEnd(), saveObject(), saveObjectTo(), and supportedTypes_.

Referenced by init().

void Core::saveAllObjectsTo (  )  [slot]

Slot for saving objects to a new location.

Save all target objects under new name (slot is called from CoreWidget's File-Menu).

Definition at line 161 of file saveFunctions.cc.

References log(), PluginFunctions::objectsEnd(), saveObjectTo(), and supportedTypes_.

Referenced by init().

bool Core::saveObject ( int  _id,
QString  _filename 
) [slot]

Save object with given id

Parameters:
_id id of the object

Save an object get object with given id, find a plugin to save dataType, save! (existing files will be overwritten)

Definition at line 59 of file saveFunctions.cc.

References CoreWidget::addRecent(), coreWidget_, BaseObject::dataType(), PluginFunctions::getObject(), and supportedTypes_.

Referenced by loadObject(), loadPlugin(), saveAllObjects(), saveObjectTo(), and saveSettings().

bool Core::saveObjectTo ( int  _id,
QString  _filename 
) [slot]

Show dialog for saving an object to a new location

Parameters:
_id id of the object
_filename current filename of the object

Save an object to a new location Show the save-widget to determine a filename, the widget calls slotSave to save the object

Definition at line 104 of file saveFunctions.cc.

References PluginFunctions::getObject(), log(), saveObject(), LoadWidget::showSave(), slotLoad(), and supportedTypes_.

Referenced by saveAllObjects(), saveAllObjectsTo(), and saveSettings().

void Core::saveSettings (  )  [slot]

Save current status to a settings file.

Save Settings (slot is called from CoreWidget's File-Menu).

Definition at line 57 of file saveSettings.cc.

References CoreWidget::addRecent(), coreWidget_, DATA_UNKNOWN, PluginFunctions::objectsEnd(), saveObject(), saveObjectTo(), writeIniFile(), and writeObjFile().

Referenced by init().

void Core::slotAddEmptyObject ( DataType  _type,
int &  _id 
) [private, slot]

Slot adding empty object of a given type.

Slot for adding an empty object of given DataType.

Definition at line 230 of file openFunctions.cc.

References addEmptyObject().

Referenced by loadPlugin(), and slotAddEmptyObjectMenu().

void Core::slotAddEmptyObjectMenu (  )  [private, slot]

Slot adding empty object from Menu.

Opens AddEmpty-Object widget.

Definition at line 472 of file openFunctions.cc.

References log(), slotAddEmptyObject(), and supportedTypes_.

Referenced by init().

void Core::slotAddTexture ( QString  _textureName,
QString  _filename,
uint  _dimension 
) [private, slot]

Called by a plugin if it creates a texture.

Called by a plugin if it created a texture. The information is passed to all plugins. If a texture control plugin is available it has to react on the signal.
See in the documentation of the texture plugin interfaces for further detail.

Definition at line 156 of file PluginCommunication.cc.

References addTexture().

void Core::slotAddTexture ( QString  _textureName,
QString  _filename,
uint  _dimension,
int  _id 
) [private, slot]

Called by a plugin if it creates a texture.

Called by a plugin if it created a texture. The information is passed to all plugins. If a texture control plugin is available it has to react on the signal.
See in the documentation of the texture plugin interfaces for further detail.

Definition at line 149 of file PluginCommunication.cc.

References addTexture().

Referenced by loadPlugin().

void Core::slotCall ( QString  _expression,
bool &  _success 
) [private, slot]

This slot executes the given expression. No checks are performed if the remote function is available.

Parameters:
_expression command to execute
_success successfull execution?

Definition at line 131 of file RPC.cc.

References log(), and scriptEngine_.

void Core::slotCall ( QString  _pluginName,
QString  _functionName,
bool &  _success 
) [private, slot]

This slot executes a function of a plugin. If it does not exist, _success will be false

Parameters:
_pluginName Plugin where the function is implemented
_functionName name of the function ( Standard name, no parameters allowed!)
_success successfull execution?

Definition at line 94 of file RPC.cc.

References log(), plugins, and scriptEngine_.

Referenced by init(), loadPlugin(), and slotGetValue().

void Core::slotCopyObject ( int  _oldId,
int &  _newId 
) [private, slot]

Slot copying an object.

Slot creating a copy of an existing object.

Definition at line 235 of file openFunctions.cc.

References BaseObject::appendChild(), BaseObject::childExists(), BaseObject::id(), log(), objectRoot_, BaseObject::parent(), BaseObject::setParent(), slotEmptyObjectAdded(), and slotObjectUpdated().

Referenced by loadPlugin().

void Core::slotEmptyObjectAdded ( int  _id  )  [private, slot]

Called when an empty object has been Added.

Slot gets called after a file-plugin has opened an object.

Todo:
: set a default path for new objects

Definition at line 437 of file openFunctions.cc.

References backupRequest(), emptyObjectAdded(), PluginFunctions::getObject(), log(), objectSelectionChanged(), and signalObjectUpdated().

Referenced by loadPlugin(), and slotCopyObject().

void Core::slotGetDescription ( QString  _function,
QString &  _fnDescription,
QStringList &  _parameters,
QStringList &  _descriptions 
) [private, slot]

get available descriptions for a given public slot

get available Descriptions for a scriptable slot

Definition at line 1028 of file Core.cc.

References log(), plugins, and PluginInfo::slotInfos.

Referenced by loadPlugin().

void Core::slotGetValue ( QString  _expression,
QVariant &  _result 
) [private, slot]

This slot executes the given expression and returns the result No checks are performed if the remote function is available. if an error occurs the result contains an invalid QVariant

ex. getValue("databaseplugin.tableExists(\"meshes\")", result) ) result.toBool() == true

Parameters:
_expression command to execute
_result The return value of the command

Definition at line 146 of file RPC.cc.

References scriptEngine_, and slotCall().

Referenced by loadPlugin().

void Core::slotLoad ( QString  _filename,
DataType  _type,
int &  _id 
) [private, slot]

A plugin wants to load a given file.

Slot for loading a given file.

Definition at line 279 of file openFunctions.cc.

References CoreWidget::addRecent(), coreWidget_, DATA_POLY_MESH, DATA_TRIANGLE_MESH, PluginFunctions::getObject(), loadObject(), MeshObject< MeshT, objectDataType >::mesh(), and slotDeleteObject().

Referenced by loadObject(), loadPlugin(), and saveObjectTo().

void Core::slotLoadPlugin (  )  [private, slot]

Load Plugins from menu.

slot for loading Plugins

Definition at line 225 of file PluginLoader.cc.

References coreWidget_, dontLoadPlugins_, loadPlugin(), and BaseInterface::name().

Referenced by slotShowPlugins().

void Core::slotLog ( Logtype  _type,
QString  _message 
) [private, slot]

Console logger.

Slot writing everything to the Logger widget.

This slot has to be called by all loggers. It is used to serialize and color the Output.

Parameters:
_type Logtype (defines the color of the output)
_message The message for output

Definition at line 93 of file Logging.cc.

References externalLog().

Referenced by init(), and loadPlugin().

void Core::slotObjectOpened ( int  _id  )  [private, slot]
void Core::slotObjectSelectionChanged ( int  _id  )  [private, slot]

Called by Plugins if they changed the active object.

This function is called if the active object has changed. The information is passed to all plugins.

Definition at line 127 of file PluginCommunication.cc.

References objectSelectionChanged().

Referenced by loadPlugin().

void Core::slotObjectUpdated ( int  _identifier  )  [private, slot]

Called by the plugins if they changed something in the object list (deleted, added,...)

Parameters:
_identifier Id of the object

This function is called by a plugin if it changed something in the object list (source,target,...). The information is passed to all plugins.

Parameters:
_identifier Id of the updated object

Definition at line 74 of file PluginCommunication.cc.

References PluginFunctions::getObject(), log(), resetScenegraph(), signalObjectUpdated(), and updateView().

Referenced by loadPlugin(), slotCopyObject(), slotDeleteAllObjects(), and slotDeleteObject().

void Core::slotSetSlotDescription ( QString  _slotName,
QString  _slotDescription,
QStringList  _parameters,
QStringList  _descriptions 
) [private, slot]

set a description for one of the plugin's public slots

set descriptions for a scriptable slot

Definition at line 989 of file Core.cc.

References log(), plugins, and PluginInfo::slotInfos.

Referenced by loadPlugin(), and setDescriptions().

void Core::slotSetTextureMode ( QString  _textureName,
QString  _mode 
) [private, slot]

A texture mode should be changed.

Called by a plugin if the parameters of a texture should be changed. The information is passed to all plugins. A Texturecontrol plugin should react on this event.
See in the documentation of the texture plugin interfaces for further detail.

Definition at line 209 of file PluginCommunication.cc.

References log(), and setTextureMode().

void Core::slotSetTextureMode ( QString  _textureName,
QString  _mode,
int  _id 
) [private, slot]

A texture mode should be changed.

Called by a plugin if the parameters of a texture should be changed. The information is passed to all plugins. A Texturecontrol plugin should react on this event.
See in the documentation of the texture plugin interfaces for further detail.

Definition at line 192 of file PluginCommunication.cc.

References log(), and setTextureMode().

Referenced by loadPlugin().

void Core::slotShowPlugins (  )  [private, slot]

Show Plugins Dialog.

slot for showing loaded Plugins

Definition at line 279 of file PluginLoader.cc.

References coreWidget_, dontLoadPlugins(), loadPlugin(), plugins, slotLoadPlugin(), and unloadPlugin().

Referenced by init().

void Core::slotSwitchTexture ( QString  _textureName  )  [private, slot]

Tells Plugins to switch to the given Texture.

Called by plugins if texture mode should be switched

Definition at line 246 of file PluginCommunication.cc.

References switchTexture().

void Core::slotSwitchTexture ( QString  _textureName,
int  _id 
) [private, slot]

Tells Plugins to switch to the given Texture.

Called by plugins if texture mode should be switched

Definition at line 240 of file PluginCommunication.cc.

References switchTexture().

Referenced by loadPlugin().

void Core::slotTextureChangeImage ( QString  _textureName,
QImage &  _image,
int  _id 
) [private, slot]

Called by plugins if texture image should be changed.

Called by plugins if texture image should be changed

Definition at line 259 of file PluginCommunication.cc.

References textureChangeImage().

void Core::slotTextureChangeImage ( QString  _textureName,
QImage &  _image 
) [private, slot]

Called by plugins if texture image should be changed.

Called by plugins if texture image should be changed

Definition at line 253 of file PluginCommunication.cc.

References textureChangeImage().

Referenced by loadPlugin().

void Core::slotTextureUpdated ( QString  _textureName,
int  _identifier 
) [private, slot]

A Texture has been updated.

Called by a plugin if it updated a texture. The information is passed to all plugins. If a texture control plugin is available it has to react on the signal and update the visualization of the texture.
See in the documentation of the texture plugin interfaces for further detail.

Definition at line 226 of file PluginCommunication.cc.

References log(), and updatedTextures().

Referenced by loadPlugin().

void Core::slotUpdateAllTextures (  )  [private, slot]

Update all textures in the plugins.

Called by a plugin if all textures should be updated. The information is passed to all plugins. All plugins providing textures should react on this event.
See in the documentation of the texture plugin interfaces for further detail.

Definition at line 185 of file PluginCommunication.cc.

References updateAllTextures().

Referenced by loadPlugin().

void Core::slotUpdateTexture ( QString  _name,
int  _identifier 
) [private, slot]

Tell the plugins to update the given texture.

Called by a plugin if a texture has to be updated. The information is passed to all plugins. The Plugin providing the given Texture should react on this event.
See in the documentation of the texture plugin interfaces for further detail.

Definition at line 163 of file PluginCommunication.cc.

References log(), and updateTexture().

Referenced by loadPlugin().

void Core::snapshot ( unsigned int  _viewerId = 0  )  [slot]

Trigger a snapshot and increase the snapshot counter. Save snapshot to file determined by snapshotBaseFileName() and the current snapshot counter. The back buffer will be saved.

Definition at line 1092 of file Core.cc.

References coreWidget_, CoreWidget::examiner_widgets_, and log().

void Core::snapshotBaseFileName ( const QString &  _fname,
unsigned int  _viewerId = 0 
) [slot]

set the baseFilename for snapshots (a counter is automatically increased when snapshot() is called)

Definition at line 1079 of file Core.cc.

References log(), Viewer::ViewerProperties::snapshotBaseFileName(), and PluginFunctions::viewerProperties().

void Core::unloadPlugin ( QString  name  )  [private, slot]

Function for unloading Plugins.

Unload a Plugin with given name (slot).

Parameters:
name plugin name

Definition at line 305 of file PluginLoader.cc.

References checkSlot(), coreWidget_, log(), plugins, and CoreWidget::viewModes_.

Referenced by loadPlugin(), and slotShowPlugins().

void Core::updateView (  )  [slot]

Called when a plugin requests an update in the viewer.

Update the view in the examiner widget

Definition at line 718 of file Core.cc.

References coreWidget_, CoreWidget::examiner_widgets_, log(), redrawTime_, and redrawTimer_.

Referenced by applyOptions(), checkScenegraphDirty(), init(), loadPlugin(), slotObjectUpdated(), and slotVisibilityChanged().

void Core::writeApplicationOptions ( INIFile _ini  )  [private]

Write Application options to ini file.

Write the standard options to the given Ini File

Parameters:
_ini Inifile to use

Definition at line 489 of file ParseIni.cc.

References INIFile::add_entry(), INIFile::add_section(), coreWidget_, dontLoadPlugins_, CoreWidget::saveKeyBindings(), saveOnExit(), INIFile::section_exists(), typeName(), PluginFunctions::viewerProperties(), PluginFunctions::viewers(), and CoreWidget::viewModes_.

Referenced by saveOptions(), writeIniFile(), and writeOnExit().

void Core::writeIniFile ( QString  _filename,
bool  _relativePaths,
bool  _targetOnly,
bool  _saveSystemSettings,
bool  _savePluginSettings,
bool  _saveObjectInfo 
) [private]

Write current status to ini file (Application and File Options).

Writes the complete status to an ini file ( All open objects and their Information )

Parameters:
_filename filename of the ini file to write with full path
_relativePaths This defines if the paths to the objects should be made relative
_targetOnly Select if we want all open objects or only the ones which are selected as target.
_saveSystemSettings Choose if you also want to save system settings into the ini file.
_savePluginSettings Choose if you want to save per Plugin global settings into the ini file.
_saveObjectInfo If you want to store information about all open objects this has to be true

Definition at line 806 of file ParseIni.cc.

References INIFile::add_entry(), INIFile::add_section(), INIFile::connect(), coreWidget_, INIFile::disconnect(), iniSave(), iniSaveOptions(), log(), PluginFunctions::objectsEnd(), typeName(), and writeApplicationOptions().

Referenced by saveSettings().

void Core::writeObjFile ( QString  _filename,
bool  _relativePaths,
bool  _targetOnly 
) [private]

Write current status to obj file (Application and File Options).

Writes the complete status to an obj file ( All open objects and their Information )

Definition at line 282 of file ParseObj.cc.

References coreWidget_, log(), and PluginFunctions::objectsEnd().

Referenced by saveSettings().


Member Data Documentation

addEmpty Widget

Pointer to the data rootNode;

Definition at line 961 of file Core.hh.

Referenced by init(), openIniFile(), preprocessObjFile(), slotCopyObject(), slotDeleteAllObjects(), slotDeleteObject(), and ~Core().


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

acg pic Project OpenFlipper, ©  Computer Graphics Group, RWTH Aachen. Documentation generated using doxygen .