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...
 
- Signals inherited from PythonInterface
virtual void executePythonScript (QString _script)
 

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 bool registerType ()=0
 
virtual int addEmpty ()=0
 Create an empty object. More...
 
virtual DataType supportedType ()=0
 Return your supported object type( e.g. DATA_TRIANGLE_MESH ) More...
 
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. More...
 
void rotateLightDirection (ACG::Vec3d &_axis, double _angle)
 Rotate spot light direction. More...
 
void updateLights ()
 Update light sources' positions. More...
 
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. More...
 
double getFarthestRadius ()
 
void addAssistLines ()
 Get number of non-directional light sources.
 
- Private Member Functions inherited from BaseInterface
virtual void noguiSupported ()
 
virtual ~BaseInterface ()
 Destructor. More...
 
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. More...
 
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. More...
 
- Private Member Functions inherited from TypeInterface
virtual ~TypeInterface ()
 Destructor. More...
 
- Private Member Functions inherited from MouseInterface
virtual ~MouseInterface ()
 Destructor. More...
 
- Private Member Functions inherited from ToolbarInterface
virtual ~ToolbarInterface ()
 Destructor. More...
 
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. More...
 
- Private Member Functions inherited from PythonInterface
virtual void openPythonScriptInEditor (QString _script)
 
virtual ~PythonInterface ()
 Destructor. More...
 

Private Attributes

std::vector< int > lightSources_
 Count light sources in scene. More...
 
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.

Constructor & Destructor Documentation

◆ ~TypeLightPlugin()

TypeLightPlugin::~TypeLightPlugin ( )
inline

Definition at line 150 of file TypeLight.hh.

◆ TypeLightPlugin()

TypeLightPlugin::TypeLightPlugin ( )

Definition at line 51 of file TypeLight.cc.

Member Function Documentation

◆ addDefaultLight()

int TypeLightPlugin::addDefaultLight ( QString  _name)

Definition at line 350 of file TypeLight.cc.

◆ addDefaultLights()

void TypeLightPlugin::addDefaultLights ( )
private

Definition at line 107 of file TypeLight.cc.

◆ 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 393 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 369 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 701 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 670 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.

◆ findDepth()

float TypeLightPlugin::findDepth ( )
private

Find depth of nearest light source.

Definition at line 424 of file TypeLight.cc.

◆ getFarthestRadius()

double TypeLightPlugin::getFarthestRadius ( )
private

Definition at line 455 of file TypeLight.cc.

◆ 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.

◆ noguiSupported

void TypeLightPlugin::noguiSupported ( )
inlineprivateslot

Definition at line 104 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 412 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 195 of file TypeLight.cc.

◆ registerType()

bool TypeLightPlugin::registerType ( )
virtual

Implements TypeInterface.

Definition at line 78 of file TypeLight.cc.

◆ removeDefaultLights()

void TypeLightPlugin::removeDefaultLights ( )
private

Definition at line 91 of file TypeLight.cc.

◆ rotateLightDirection()

void TypeLightPlugin::rotateLightDirection ( ACG::Vec3d _axis,
double  _angle 
)
private

Rotate spot light direction.

Definition at line 741 of file TypeLight.cc.

◆ rotateLights()

void TypeLightPlugin::rotateLights ( ACG::Vec3d _axis,
double  _angle 
)
private

Rotate light sources.

Definition at line 732 of file TypeLight.cc.

◆ showReducedUi()

void TypeLightPlugin::showReducedUi ( bool  reduced)

Definition at line 191 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 85 of file TypeLight.cc.

◆ slotLightModeRequest

void TypeLightPlugin::slotLightModeRequest ( bool  _checked)
privateslot

Definition at line 301 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 483 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 295 of file TypeLight.cc.

◆ slotPickModeRequest

void TypeLightPlugin::slotPickModeRequest ( QAction *  _action)
privateslot

Definition at line 314 of file TypeLight.cc.

◆ slotSetAllOrTarget

void TypeLightPlugin::slotSetAllOrTarget ( bool  _checked)
privateslot

Definition at line 344 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.

◆ updateLights()

void TypeLightPlugin::updateLights ( )
private

Update light sources' positions.

Definition at line 769 of file TypeLight.cc.

◆ version

QString TypeLightPlugin::version ( )
inlineslot

Definition at line 161 of file TypeLight.hh.

Member Data Documentation

◆ allLightsMode_

QAction* TypeLightPlugin::allLightsMode_
private

Definition at line 213 of file TypeLight.hh.

◆ defaultLights_

bool TypeLightPlugin::defaultLights_
private

Definition at line 195 of file TypeLight.hh.

◆ depth_

float TypeLightPlugin::depth_
private

Definition at line 233 of file TypeLight.hh.

◆ hitLightTrackball_

bool TypeLightPlugin::hitLightTrackball_
private

Definition at line 240 of file TypeLight.hh.

◆ hitTrackball_

bool TypeLightPlugin::hitTrackball_
private

Definition at line 241 of file TypeLight.hh.

◆ lastPoint2D_

QPoint TypeLightPlugin::lastPoint2D_
private

Definition at line 220 of file TypeLight.hh.

◆ lastPoint3D_

ACG::Vec3d TypeLightPlugin::lastPoint3D_
private

Definition at line 221 of file TypeLight.hh.

◆ light_matrix_

ACG::GLMatrixd TypeLightPlugin::light_matrix_
private

Definition at line 198 of file TypeLight.hh.

◆ lightAction_

QAction* TypeLightPlugin::lightAction_
private

Definition at line 207 of file TypeLight.hh.

◆ lightCenter_

ACG::Vec3d TypeLightPlugin::lightCenter_
private

Definition at line 236 of file TypeLight.hh.

◆ lightId_

int TypeLightPlugin::lightId_
private

Definition at line 238 of file TypeLight.hh.

◆ lightOptions_

QToolBar* TypeLightPlugin::lightOptions_
private

Definition at line 204 of file TypeLight.hh.

◆ lightRadius_

double TypeLightPlugin::lightRadius_
private

Definition at line 237 of file TypeLight.hh.

◆ lightSources_

std::vector<int> TypeLightPlugin::lightSources_
private

Count light sources in scene.

Definition at line 193 of file TypeLight.hh.

◆ moveMode_

QAction* TypeLightPlugin::moveMode_
private

Definition at line 209 of file TypeLight.hh.

◆ onlyTargets_

bool TypeLightPlugin::onlyTargets_
private

Definition at line 217 of file TypeLight.hh.

◆ planeDepth_

float TypeLightPlugin::planeDepth_
private

Definition at line 225 of file TypeLight.hh.

◆ radius_

double TypeLightPlugin::radius_
private

Definition at line 230 of file TypeLight.hh.

◆ rotateMode_

QAction* TypeLightPlugin::rotateMode_
private

Definition at line 211 of file TypeLight.hh.

◆ rotation_

bool TypeLightPlugin::rotation_
private

Definition at line 227 of file TypeLight.hh.

◆ toolbar_

QToolBar* TypeLightPlugin::toolbar_
private

Definition at line 201 of file TypeLight.hh.

◆ translateMode_

QAction* TypeLightPlugin::translateMode_
private

Definition at line 210 of file TypeLight.hh.

◆ transVec_

ACG::Vec3d TypeLightPlugin::transVec_
private

Definition at line 226 of file TypeLight.hh.

◆ viewerToolbarAction_

QAction* TypeLightPlugin::viewerToolbarAction_
private

Definition at line 214 of file TypeLight.hh.


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