CGAL 4.12.2 - Three
|
#include <CGAL/Three/Polyhedron_demo_plugin_helper.h>
CGAL::Three::Polyhedron_demo_plugin_interface.
Provides convenient functions for a plugin.
This class provides convenient functions to manage dock_widgets and to access a certain type of items in the scene. It also provides member variables for a Scene_interface and a QMainWindow.
Public Member Functions | |
template<class SceneType > | |
SceneType * | getSelectedItem () const |
Gets an item of the templated type. More... | |
void | addDockWidget (QDockWidget *dock) |
Adds a dock widget to the interface. More... | |
void | autoConnectActions () |
Automatically connects each action of the plugin to the corresponding slot. More... | |
![]() | |
virtual void | init (QMainWindow *, CGAL::Three::Scene_interface *, Messages_interface *)=0 |
Initializes the plugin This function acts like a constructor. More... | |
virtual bool | applicable (QAction *action) const =0 |
Indicates if an action is usable or not. More... | |
virtual QList< QAction * > | actions () const =0 |
Contains all the plugin's actions. | |
virtual void | closure () |
Is called when the application is closed. More... | |
Protected Attributes | |
CGAL::Three::Scene_interface * | scene |
The reference to the scene. | |
QMainWindow * | mw |
The reference to the main window. | |
void CGAL::Three::Polyhedron_demo_plugin_helper::addDockWidget | ( | QDockWidget * | dock | ) |
Adds a dock widget to the interface.
Adds a dock widget in the left section of the MainWindow. If the slot is already taken, the dock widgets will be tabified.
void CGAL::Three::Polyhedron_demo_plugin_helper::autoConnectActions | ( | ) |
Automatically connects each action of the plugin to the corresponding slot.
ActionName
in the plugin's actions()
list must have a corresponding slot named on_ActionsName_triggered()
in the plugin. SceneType* CGAL::Three::Polyhedron_demo_plugin_helper::getSelectedItem | ( | ) | const |
Gets an item of the templated type.
SceneType
item SceneType
item found in the scene's list of items if the selected item is not a SceneType
SceneType
in the list.