Developer Documentation
ComponentsPlugin Class Reference
Inheritance diagram for ComponentsPlugin:
ScriptInterface ToolbarInterface LoadSaveInterface BackupInterface LoggingInterface PickingInterface MouseInterface BaseInterface

Public Slots

QString version ()
 
Scripting Functions
IdList splitComponents (int _objectId)
 Splits the object into components. More...
 
void biggestComponent (int _objId)
 Gets the biggest connected component of a mesh. More...
 

Signals

void updateView ()
 
void updatedObject (int _identifier, const UpdateType &_type)
 
void setSlotDescription (QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
 
void addEmptyObject (DataType _type, int &_id)
 
void copyObject (int _oldId, int &_newId)
 
void addToolbar (QToolBar *_toolbar)
 
void getToolBar (QString _name, QToolBar *&_toolbar)
 
void addPickMode (const std::string &_mode)
 
void scriptInfo (QString _functionName)
 
void log (Logtype _type, QString _message)
 
void log (QString _message)
 
void createBackup (int _objectid, QString _name, UpdateType _type)
 
void deleteObject (int _id)
 
- 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 PickingInterface
virtual void addPickMode (const std::string &_mode)
 Add a new picking mode to the examiner. More...
 
- Signals inherited from LoggingInterface
virtual void log (Logtype _type, QString _message)=0
 
virtual void log (QString _message)=0
 
- Signals inherited from BackupInterface
virtual void createBackup (int _objectid, QString _name, UpdateType _type=UPDATE_ALL)
 Tell Backup Plugin to create a backup. More...
 
virtual void aboutToRestore (int _objectid)
 Backup Plugin tells other Plugins that a restore will happen. More...
 
virtual void generateBackup (int _id, QString _name, UpdateType _type)
 This signal is emitted by a BackupPlugin and tells a TypePlugin to generate a backup. More...
 
- Signals inherited from LoadSaveInterface
virtual void save (int _id, QString _filename)
 Save object to a file. More...
 
virtual void load (QString _filename, DataType _type, int &_id)
 Load object from file with a specific DataType. More...
 
- Signals inherited from ToolbarInterface
virtual void addToolbar (QToolBar *_toolbar)
 Adds a Toolbar to the main widget. 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)
 

Public Member Functions

 ComponentsPlugin ()
 Constructor. More...
 
void exit ()
 
QString name ()
 Return a name for the plugin. More...
 
QString description ()
 Return a description of what the plugin is doing. More...
 

Private Slots

void initializePlugin ()
 Initialize the plugin. More...
 
void noguiSupported ()
 
- Private Slots inherited from BaseInterface
virtual QString version ()
 Return a version string for your plugin. More...
 

Private Member Functions

void pluginsInitialized ()
 Second initialization phase. More...
 
void slotPickModeChanged (const std::string &_mode)
 the pickMode changed More...
 
void slotMouseEvent (QMouseEvent *_event)
 a mouse event occured More...
 
void setDescriptions ()
 set scripting slot descriptions More...
 
Template Functions
template<class MeshT >
void splitComponent (MeshT *_mesh, MeshT *_copy)
 Split mesh into components. More...
 
template<class MeshT >
void selectBiggestComponent (MeshT *_mesh)
 Select the biggest component of the mesh. More...
 
template<class MeshT >
void deleteUnselectedFaces (MeshT *_mesh)
 Deletes all faces of a mesh that are not selected. More...
 
- 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 MouseInterface
virtual ~MouseInterface ()
 Destructor.
 
- Private Member Functions inherited from PickingInterface
virtual void addHiddenPickMode (const std::string &_mode)
 Add a new picking mode to the examiner which will be invisible. More...
 
virtual void setPickModeCursor (const std::string &_mode, QCursor _cursor)
 Set the cursor of the given PickMode. More...
 
virtual void setPickModeMouseTracking (const std::string &_mode, bool _mouseTracking)
 Set mouse tracking for the given PickMode. More...
 
virtual void setPickModeToolbar (const std::string &_mode, QToolBar *_toolbar)
 Set the additional toolbar of the given PickMode. More...
 
virtual void removePickModeToolbar (const std::string &_mode)
 Removes the additional toolbar of the given PickMode. More...
 
virtual ~PickingInterface ()
 Destructor.
 
- Private Member Functions inherited from LoggingInterface
virtual ~LoggingInterface ()
 Destructor.
 
- Private Member Functions inherited from BackupInterface
virtual void createBackup (IdList _objectids, QString _name, std::vector< UpdateType > _types)
 Tell Backup Plugin to create a group backup. More...
 
virtual void undo (int _objectid)
 Tell Backup Plugin to undo the last action of an object. More...
 
virtual void redo (int _objectid)
 Tell Backup Plugin to redo the last action on an object. More...
 
virtual void undo ()
 Tell Backup Plugin to undo the last action. More...
 
virtual void redo ()
 Tell Backup Plugin to redo the last action. More...
 
virtual ~BackupInterface ()
 Destructor.
 
virtual void restored (int _objectid)
 Backup Plugin tells other Plugins that a restore has happened. More...
 
- Private Member Functions inherited from LoadSaveInterface
virtual ~LoadSaveInterface ()
 Destructor.
 
virtual void addEmptyObject (DataType _type, int &_id)
 
virtual void copyObject (int _oldId, int &_newId)
 
virtual void emptyObjectAdded (int _id)
 DEPRECATED HERE (Moved to Type Interface)! Emit this signal if an empty object has been created. More...
 
virtual void deleteObject (int _id)
 Delete an object
This signal can be called from any thread.
. More...
 
virtual void deleteAllObjects ()
 Delete all Objects. More...
 
virtual void getAllFileFilters (QStringList &_filters)
 Get all file filters that are registered. More...
 
- 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 ScriptInterface
virtual ~ScriptInterface ()
 Destructor.
 
virtual void executeFileScript (QString _filename)
 
virtual void getDescription (QString _function, QString &_description, QStringList &_parameters, QStringList &_descriptions)
 

GUI Related

QAction * splitAction_
 Split into Components Button was hit. More...
 
QAction * biggestAction_
 Split into Components Button was hit. More...
 
void slotSplitComponentsButton ()
 Split into Components Button was hit. More...
 
void slotBiggestComponentButton ()
 Split into Components Button was hit. More...
 
void splitComponents (QMouseEvent *_event)
 Split Components of picked object. More...
 
void biggestComponent (QMouseEvent *_event)
 Split into Components Button was hit. More...
 

Detailed Description

Definition at line 59 of file ComponentsPlugin.hh.

Constructor & Destructor Documentation

◆ ComponentsPlugin()

ComponentsPlugin::ComponentsPlugin ( )

Constructor.

Definition at line 53 of file ComponentsPlugin.cc.

Member Function Documentation

◆ biggestComponent [1/2]

void ComponentsPlugin::biggestComponent ( QMouseEvent *  _event)
privateslot

Split into Components Button was hit.

Definition at line 180 of file ComponentsPlugin.cc.

◆ biggestComponent [2/2]

void ComponentsPlugin::biggestComponent ( int  _objId)
slot

Gets the biggest connected component of a mesh.

i.e. deletes all components except the one with the maximal number of faces

Parameters
_objIdid of the target object

Definition at line 209 of file ComponentsScripting.cc.

◆ deleteUnselectedFaces()

template<class MeshT >
void ComponentsPlugin::deleteUnselectedFaces ( MeshT *  _mesh)
private

Deletes all faces of a mesh that are not selected.

Use selectBiggestcomponent first to select the biggest component. Than use this function to remove all other parts of the mesh.

Parameters
_meshthe mesh to work on

Definition at line 167 of file ComponentsPluginT_impl.hh.

◆ description()

QString ComponentsPlugin::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 125 of file ComponentsPlugin.hh.

◆ exit()

void ComponentsPlugin::exit ( )
inlinevirtual

This function is called when the application exits or when your plugin is about to be unloaded. Here you can clean up your plugin, delete local variables...

Reimplemented from BaseInterface.

Definition at line 122 of file ComponentsPlugin.hh.

◆ initializePlugin

void ComponentsPlugin::initializePlugin ( )
privateslot

Initialize the plugin.

Definition at line 64 of file ComponentsPlugin.cc.

◆ name()

QString ComponentsPlugin::name ( )
inlinevirtual

Return a name for the plugin.

This Function has to return the name of the plugin.

Implements BaseInterface.

Definition at line 124 of file ComponentsPlugin.hh.

◆ pluginsInitialized()

void ComponentsPlugin::pluginsInitialized ( )
privatevirtual

Second initialization phase.

Reimplemented from BaseInterface.

Definition at line 73 of file ComponentsPlugin.cc.

◆ selectBiggestComponent()

template<class MeshT >
void ComponentsPlugin::selectBiggestComponent ( MeshT *  _mesh)
private

Select the biggest component of the mesh.

This function will select the component of the mesh which has the most faces

Parameters
_meshthe mesh to work on

Definition at line 117 of file ComponentsPluginT_impl.hh.

◆ setDescriptions()

void ComponentsPlugin::setDescriptions ( )
private

set scripting slot descriptions

Set Descriptions for all scripting slots.

Definition at line 51 of file ComponentsScripting.cc.

◆ slotBiggestComponentButton

void ComponentsPlugin::slotBiggestComponentButton ( )
privateslot

Split into Components Button was hit.

Definition at line 174 of file ComponentsPlugin.cc.

◆ slotMouseEvent()

void ComponentsPlugin::slotMouseEvent ( QMouseEvent *  _event)
privatevirtual

a mouse event occured

Parameters
_eventthe event that occured

Reimplemented from MouseInterface.

Definition at line 125 of file ComponentsPlugin.cc.

◆ slotPickModeChanged()

void ComponentsPlugin::slotPickModeChanged ( const std::string &  _mode)
privatevirtual

the pickMode changed

Parameters
_modethe new pickMode

Reimplemented from PickingInterface.

Definition at line 112 of file ComponentsPlugin.cc.

◆ slotSplitComponentsButton

void ComponentsPlugin::slotSplitComponentsButton ( )
privateslot

Split into Components Button was hit.

Definition at line 140 of file ComponentsPlugin.cc.

◆ splitComponent()

template<class MeshT >
void ComponentsPlugin::splitComponent ( MeshT *  _mesh,
MeshT *  _copy 
)
private

Split mesh into components.

This function will split an arbitrary component out of a mesh. It takes a copy of the original mesh.

Parameters
_meshthe original mesh
_copyoriginal mesh copy with identical topology and geometry the copy will contain one component of the original mesh.

Definition at line 55 of file ComponentsPluginT_impl.hh.

◆ splitComponents [1/2]

void ComponentsPlugin::splitComponents ( QMouseEvent *  _event)
privateslot

Split Components of picked object.

Split components (triggered by pickMode)

Parameters
_eventthe mouse event that occured

Definition at line 153 of file ComponentsPlugin.cc.

◆ splitComponents [2/2]

IdList ComponentsPlugin::splitComponents ( int  _objectId)
slot

Splits the object into components.

i.e. creates ( number of components) new meshes and deletes the old mesh

Parameters
_objectIdid of the target object

Definition at line 63 of file ComponentsScripting.cc.

Member Data Documentation

◆ biggestAction_

QAction* ComponentsPlugin::biggestAction_
private

Split into Components Button was hit.

Definition at line 148 of file ComponentsPlugin.hh.

◆ splitAction_

QAction* ComponentsPlugin::splitAction_
private

Split into Components Button was hit.

Definition at line 147 of file ComponentsPlugin.hh.


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