\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 4.12.2 - Three
CGAL::Three::Polyhedron_demo_plugin_helper Class Reference

#include <CGAL/Three/Polyhedron_demo_plugin_helper.h>

Inherits from

CGAL::Three::Polyhedron_demo_plugin_interface.

Definition

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.

Examples:
Three/Example_plugin/Dock_widget_plugin.cpp, and Three/Example_plugin/Example_plugin.cpp.

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...
 
- Public Member Functions inherited from CGAL::Three::Polyhedron_demo_plugin_interface
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_interfacescene
 The reference to the scene.
 
QMainWindow * mw
 The reference to the main window.
 

Member Function Documentation

◆ addDockWidget()

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.

◆ autoConnectActions()

void CGAL::Three::Polyhedron_demo_plugin_helper::autoConnectActions ( )

Automatically connects each action of the plugin to the corresponding slot.

Attention
Each action named ActionName in the plugin's actions() list must have a corresponding slot named on_ActionsName_triggered() in the plugin.

◆ getSelectedItem()

template<class SceneType >
SceneType* CGAL::Three::Polyhedron_demo_plugin_helper::getSelectedItem ( ) const

Gets an item of the templated type.

Returns
The currently selected SceneType item
the first SceneType item found in the scene's list of items if the selected item is not a SceneType
NULL if there is no SceneType in the list.