Developer Documentation
TypeLightPlugin Class Reference
Inheritance diagram for TypeLightPlugin:
PythonInterface PickingInterface ToolbarInterface MouseInterface TypeInterface LoggingInterface LoadSaveInterface BaseInterface

Public Slots

QString version ()
 

Signals

void log (Logtype _type, QString _message)
 
void log (QString _message)
 
void addEmptyObject (DataType _type, int &_id)
 
void emptyObjectAdded (int _id)
 
void deleteObject (int _id)
 
void updatedObject (int _id, const UpdateType &_type)
 
void updateView ()
 
void getToolBar (QString _name, QToolBar *&_toolbar)
 
void addPickMode (const std::string &_mode)
 
void addHiddenPickMode (const std::string &_mode)
 
void setPickModeMouseTracking (const std::string &_mode, bool _mouseTracking)
 
void setPickModeToolbar (const std::string &_mode, QToolBar *_toolbar)
 
- 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 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 LoggingInterface
virtual void log (Logtype _type, QString _message)=0
 
virtual void log (QString _message)=0
 
- Signals inherited from TypeInterface
virtual void emptyObjectAdded (int _id)
 Emit this signal if an empty object has been created. More...
 
- Signals inherited from ToolbarInterface
virtual void addToolbar (QToolBar *_toolbar)
 Adds a Toolbar to the main widget. More...
 
- Signals inherited from PickingInterface
virtual void addPickMode (const std::string &_mode)
 Add a new picking mode to the examiner. More...
 

Public Member Functions

QString name ()
 Return a name for the plugin. More...
 
QString description ()
 Return a description of what the plugin is doing. More...
 
bool registerType ()
 
int addEmpty ()
 Create an empty object. More...
 
DataType supportedType ()
 Return your supported object type( e.g. DATA_TRIANGLE_MESH ) More...
 
void pluginsInitialized ()
 Initialize Plugin step 2. More...
 
int addDefaultLight (QString _name)
 
void showReducedUi (bool reduced)
 

Private Slots

void noguiSupported ()
 
void slotLightModeRequest (bool _checked)
 
void slotPickModeRequest (QAction *_action)
 
void slotSetAllOrTarget (bool _checked)
 
- Private Slots inherited from BaseInterface
virtual void exit ()
 
virtual QString version ()
 Return a version string for your plugin. More...
 
- Private Slots inherited from TypeInterface
virtual void generateBackup (int _id, QString _name, UpdateType _type)
 This slot should be implemented in a TypePlugin to generate type specific backups. More...
 

Private Member Functions

void slotPickModeChanged (const std::string &_pickMode)
 The pickingMode has changed. More...
 
void slotAllCleared ()
 Called if the whole scene is cleared. More...
 
void addDefaultLights ()
 
void removeDefaultLights ()
 
void addedEmptyObject (int _id)
 An empty object has been added. More...
 
void objectDeleted (int _id)
 An object was deleted. More...
 
void slotMouseEventLight (QMouseEvent *_event)
 Mouse Event from main application ( Light Mode ) More...
 
void rotateLights (ACG::Vec3d &_axis, double _angle)
 Rotate light sources.
 
void rotateLightDirection (ACG::Vec3d &_axis, double _angle)
 Rotate spot light direction.
 
void updateLights ()
 Update light sources' positions.
 
bool computeClickOnTrackball (const QPoint &_v2D, ACG::Vec3d &_clickOnSphere, ACG::GLState &_state)
 Compute click on trackball containing the light source. More...
 
bool computeClickOnLightTrackball (const QPoint &_v2D, ACG::Vec3d &_clickOnSphere, ACG::GLState &_state)
 Compute click on trackball of light source. More...
 
float findDepth ()
 Find depth of nearest light source.
 
double getFarthestRadius ()
 
void addAssistLines ()
 Get number of non-directional light sources.
 
- 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 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 LoggingInterface
virtual ~LoggingInterface ()
 Destructor.
 
- Private Member Functions inherited from TypeInterface
virtual ~TypeInterface ()
 Destructor.
 
- Private Member Functions inherited from MouseInterface
virtual ~MouseInterface ()
 Destructor.
 
- 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 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 PythonInterface
virtual ~PythonInterface ()
 Destructor.
 

Private Attributes

std::vector< int > lightSources_
 Count light sources in scene.
 
bool defaultLights_
 
ACG::GLMatrixd light_matrix_
 
QToolBar * toolbar_
 
QToolBar * lightOptions_
 
QAction * lightAction_
 
QAction * moveMode_
 
QAction * translateMode_
 
QAction * rotateMode_
 
QAction * allLightsMode_
 
QAction * viewerToolbarAction_
 
bool onlyTargets_
 
QPoint lastPoint2D_
 
ACG::Vec3d lastPoint3D_
 
float planeDepth_
 
ACG::Vec3d transVec_
 
bool rotation_
 
double radius_
 
float depth_
 
ACG::Vec3d lightCenter_
 
double lightRadius_
 
int lightId_
 
bool hitLightTrackball_
 
bool hitTrackball_
 

Detailed Description

Definition at line 63 of file TypeLight.hh.

Member Function Documentation

◆ addedEmptyObject()

void TypeLightPlugin::addedEmptyObject ( int  _id)
privatevirtual

An empty object has been added.

Slot is called if an empty object has been added by the core.
This slot will be executed on the main thread.

Parameters
_idId of the new object

Reimplemented from LoadSaveInterface.

Definition at line 392 of file TypeLight.cc.

◆ addEmpty()

int TypeLightPlugin::addEmpty ( )
virtual

Create an empty object.

When this slot is called you have to create an object of your supported type.

Returns
Id of the new Object

Implements TypeInterface.

Definition at line 368 of file TypeLight.cc.

◆ computeClickOnLightTrackball()

bool TypeLightPlugin::computeClickOnLightTrackball ( const QPoint &  _v2D,
ACG::Vec3d _clickOnSphere,
ACG::GLState _state 
)
private

Compute click on trackball of light source.

Compute click on trackball having the light's center as center point.

Definition at line 698 of file TypeLight.cc.

◆ computeClickOnTrackball()

bool TypeLightPlugin::computeClickOnTrackball ( const QPoint &  _v2D,
ACG::Vec3d _clickOnSphere,
ACG::GLState _state 
)
private

Compute click on trackball containing the light source.

Compute click on trackball having the trackball center of the scene as center point.

Definition at line 667 of file TypeLight.cc.

◆ description()

QString TypeLightPlugin::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 154 of file TypeLight.hh.

◆ name()

QString TypeLightPlugin::name ( )
inlinevirtual

Return a name for the plugin.

This Function has to return the name of the plugin.

Implements BaseInterface.

Definition at line 153 of file TypeLight.hh.

◆ objectDeleted()

void TypeLightPlugin::objectDeleted ( int  _id)
privatevirtual

An object was deleted.

This function is called by the core if an object gets deleted. It is called immediately before the object is removed from the scenegraph. So if this function is invoked, the object still exists. All plugins get informed via this slot.\

After this function got called for all plugins, the object is removed from the scene with all nodes attached to it and all PerObjectData attached to it.
This slot will be executed on the main thread.

Parameters
_idId of the object that is deleted.

Reimplemented from LoadSaveInterface.

Definition at line 411 of file TypeLight.cc.

◆ pluginsInitialized()

void TypeLightPlugin::pluginsInitialized ( )
virtual

Initialize Plugin step 2.

This slot is called if all plugins are loaded and the core is ready. Afterwards you can already send signals to other plugins and the core (e.g. adding global textures).

Note
Do not create objects via addEmpty or load objects in this slot, as the rendering system is not ready yet.

Reimplemented from BaseInterface.

Definition at line 194 of file TypeLight.cc.

◆ slotAllCleared()

void TypeLightPlugin::slotAllCleared ( )
privatevirtual

Called if the whole scene is cleared.

This slot is called if the main application cleared the whole scene. No objects will remain in memory and all destructors of the objects are called before this signal is emitted.

Reimplemented from BaseInterface.

Definition at line 84 of file TypeLight.cc.

◆ slotMouseEventLight()

void TypeLightPlugin::slotMouseEventLight ( QMouseEvent *  _event)
privatevirtual

Mouse Event from main application ( Light Mode )

This slot is called if a mouse event occurred in the Viewer This slot will only get called in LightMode. Right button clicks will not be passed to the plugins as this is reserved for the context Menu.

Parameters
_eventMouse event

Reimplemented from MouseInterface.

Definition at line 482 of file TypeLight.cc.

◆ slotPickModeChanged()

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

The pickingMode has changed.

This slot is called if the user changes the current picking mode

Parameters
_modeIdentifier of Picking mode

Reimplemented from PickingInterface.

Definition at line 294 of file TypeLight.cc.

◆ supportedType()

DataType TypeLightPlugin::supportedType ( )
inlinevirtual

Return your supported object type( e.g. DATA_TRIANGLE_MESH )

The function is used from addEmpty in the core to check if your plugin can create an object of a given dataType. If so, your addEmpty function will be invoked to create it.

Implements TypeInterface.

Definition at line 165 of file TypeLight.hh.


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