Developer Documentation

Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
InfoMeshObjectPlugin Class Reference

Plugin to visualize information about objects in the scene. More...

`#include <Plugin-InfoMeshObject/MeshObjectInfoPlugin.hh>`

Inheritance diagram for InfoMeshObjectPlugin:

## Signals
void | setSlotDescription (QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
void | log (Logtype _type, QString _message)
void | log (QString _message)
void | addWidgetToStatusbar (QWidget *_widget)
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 LoggingInterface
virtual void | log (Logtype _type, QString _message)=0
virtual void | log (QString _message)=0
Signals inherited from StatusbarInterface
virtual void | showStatusMessage (QString _message, int _timeout=0)
| Show a message in the status bar. 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...

## Public Member Functions
QString | name ()
| Name of the Plugin.
QString | description ()
| Description of the Plugin.

## Private Slots
void | initializePlugin ()
void | pluginsInitialized ()
| initialize the plugin
void | slotObjectUpdated (int _identifier, const UpdateType &_type)
void | slotObjectSelectionChanged (int _identifier)
void | slotAllCleared ()
void | objectDeleted (int _identifier)
void | noguiSupported ()
Private Slots inherited from BaseInterface
virtual void | exit ()
virtual QString | version ()
| Return a version string for your plugin. More...
Private Slots inherited from InformationInterface

## Private Member Functions
void | slotInformationRequested (const QPoint _clickedPoint, DataType _type)
| Show information dialog on clicked object. More...
DataType | supportedDataTypes ()
| Get data type for information requests. More...
void | slotShowHistogram ()
template<class MeshT >
void | printMeshInfo (MeshT *_mesh, int _id, unsigned int _face, ACG::Vec3d &_hitPoint)
void | updateData (int _identifier, const UpdateType &_type, const bool deleted)
| Slot that updates the visualization.
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 InformationInterface
virtual | ~InformationInterface ()
| Default destructor.
Private Member Functions inherited from LoggingInterface
virtual | ~LoggingInterface ()
| Destructor.
Private Member Functions inherited from StatusbarInterface
virtual | ~StatusbarInterface ()
| Destructor.
void | setStatus (ApplicationStatus::applicationStatus _status)
| Sets the status icon of the StatusBar. More...
void | clearStatusMessage ()
| Removes the current message from the statusBar. More...
void | addWidgetToStatusbar (QWidget *_widget)
| Add a widget on the right side of the statusBar. 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 PythonInterface
virtual | ~PythonInterface ()
| Destructor.

## Private Attributes
InfoDialog * | info_
InfoBar * | infoBar_
BaseObjectData * | lastPickedObject_
int | lastPickedObjectId_

## Scripting Functions
void | setDescriptions ()
| set scripting slot descriptions More...
template<class MeshT >
int | getClosestVertexInFace (MeshT *_mesh, int _face_idx, ACG::Vec3d &_hitPoint)
| Get closest vertex index from a face. More...
template<class MeshT >
int | getClosestEdgeInFace (MeshT *_mesh, int _face_idx, const ACG::Vec3d &_hitPoint)
| Get closest edge index from a face. More...
template<class MeshT >
int | getClosestVertexFromEdge (MeshT *_mesh, int _edge_idx, ACG::Vec3d &_hitPoint)
| Get closest vertex index from an edge. More...
template<class MeshT >
void | getEdgeLengths (MeshT *_mesh, double &min, double &max, double &mean)
| Get edge lengths.
bool | getEdgeLengths (int _id, double &min, double &max, double &mean)
| Get edge lengths.
int | vertexCount (int _id)
| get total number of vertices for a given object More...
int | edgeCount (int _id)
| get total number of edges for a given object More...
int | faceCount (int _id)
| get total number of faces for a given object More...
int | boundaryCount (int _id)
| get the number of boundaries for a given object More...
int | componentCount (int _id)
| get the number of components for a given object More...
int | genus (int _id)
| get the genus of the given object More...
Vector | cog (int _id)
| get the center of gravity More...
Vector | boundingBoxMin (int _id)
| get minumum bounding box point More...
Vector | boundingBoxMax (int _id)
| get maximum bounding box point More...
Vector | boundingBoxSize (int _id)
| get the size of the bounding box More...
double | edgeLength (int _id, int _edgeHandle)
| get the length of an edge More...
double | faceArea (int _id, int _faceHandle)
| get the area of a face More...
double | aspectRatio (int _id, int _faceHandle)
| get the aspect ratio of a face More...
int | vertexValence (int _id, int _vertexHandle)
| get vertex valence More...
double | minEdgeLength (int _id)
| get the minimal edge length More...
double | maxEdgeLength (int _id)
| get the maximal edge length More...
double | meanEdgeLength (int _id)
| get the mean edge length More...
QString | version ()
| set scripting slot descriptions More...

## Detailed Description

Plugin to visualize information about objects in the scene.

Plugin to visualize information about objects in the scene

Definition at line 78 of file MeshObjectInfoPlugin.hh.

## Member Function Documentation

## ◆ aspectRatio

double InfoMeshObjectPlugin::aspectRatio | ( | int | _id,
|  | int | _faceHandle
| ) |  |
| slot

get the aspect ratio of a face

Parameters

  _id | id of an object
  _faceHandle | face handle

Returns
  aspect ratio or -1 if an error occured

Definition at line 707 of file MeshObjectInfoScripting.cc.

## ◆ boundaryCount

int InfoMeshObjectPlugin::boundaryCount | ( | int | _id | ) |
| slot

get the number of boundaries for a given object

Parameters

  _id | object id

Returns
  number of boundaries or -1 if an error occured

Definition at line 248 of file MeshObjectInfoScripting.cc.

## ◆ boundingBoxMax

Vector InfoMeshObjectPlugin::boundingBoxMax | ( | int | _id | ) |
| slot

get maximum bounding box point

get maximum point of the (axis aligned) bounding box

Parameters

  _id | id of an object

Returns
  maximum point of the bounding box

Definition at line 466 of file MeshObjectInfoScripting.cc.

## ◆ boundingBoxMin

Vector InfoMeshObjectPlugin::boundingBoxMin | ( | int | _id | ) |
| slot

get minumum bounding box point

get minimum point of the (axis aligned) bounding box

Parameters

  _id | id of an object

Returns
  minimum point of the bounding box

Definition at line 416 of file MeshObjectInfoScripting.cc.

## ◆ boundingBoxSize

Vector InfoMeshObjectPlugin::boundingBoxSize | ( | int | _id | ) |
| slot

get the size of the bounding box

get the size of the (axis aligned) bounding box

Parameters

  _id | id of an object

Returns
  size of the bounding box

Definition at line 516 of file MeshObjectInfoScripting.cc.

## ◆ cog

Vector InfoMeshObjectPlugin::cog | ( | int | _id | ) |
| slot

get the center of gravity

Parameters

  _id | id of an object

Returns
  the center of gravity

Definition at line 374 of file MeshObjectInfoScripting.cc.

## ◆ componentCount

int InfoMeshObjectPlugin::componentCount | ( | int | _id | ) |
| slot

get the number of components for a given object

Parameters

  _id | object id

Returns
  number of components or -1 if an error occured

Definition at line 290 of file MeshObjectInfoScripting.cc.

## ◆ edgeCount

int InfoMeshObjectPlugin::edgeCount | ( | int | _id | ) |
| slot

get total number of edges for a given object

Parameters

  _id | object id

Returns
  number of edges or -1 if an error occured

Definition at line 164 of file MeshObjectInfoScripting.cc.

## ◆ edgeLength

double InfoMeshObjectPlugin::edgeLength | ( | int | _id,
|  | int | _edgeHandle
| ) |  |
| slot

get the length of an edge

Parameters

  _id | id of an object
  _edgeHandle | edge handle

Returns
  edge length or -1 if an error occured

Definition at line 567 of file MeshObjectInfoScripting.cc.

## ◆ faceArea

double InfoMeshObjectPlugin::faceArea | ( | int | _id,
|  | int | _faceHandle
| ) |  |
| slot

get the area of a face

Parameters

  _id | id of an object
  _faceHandle | face handle

Returns
  face area or -1 if an error occured

TODO implement polygonArea

Definition at line 632 of file MeshObjectInfoScripting.cc.

## ◆ faceCount

int InfoMeshObjectPlugin::faceCount | ( | int | _id | ) |
| slot

get total number of faces for a given object

Parameters

  _id | object id

Returns
  number of faces or -1 if an error occured

Definition at line 206 of file MeshObjectInfoScripting.cc.

## ◆ genus

int InfoMeshObjectPlugin::genus | ( | int | _id | ) |
| slot

get the genus of the given object

Parameters

  _id | id of an object

Returns
  the genus

TODO this formula only works for closed objects: fix it

Definition at line 332 of file MeshObjectInfoScripting.cc.

## ◆ getClosestEdgeInFace()

template<class MeshT >

int InfoMeshObjectPlugin::getClosestEdgeInFace | ( | MeshT * | _mesh,
|  | int | _face_idx,
|  | const ACG::Vec3d & | _hitPoint
| ) |  |
| private

Get closest edge index from a face.

Find closest edge to selection.

Parameters

  _mesh | Reference to the mesh
  _face_idx | Index of the face that has been clicked on
  _hitPoint | The point which will be tested

Returns
  index of the closest edge in the face to the hitpoint

Definition at line 649 of file MeshObjectInfoPlugin.cc.

## ◆ getClosestVertexFromEdge()

template<class MeshT >

int InfoMeshObjectPlugin::getClosestVertexFromEdge | ( | MeshT * | _mesh,
|  | int | _edge_idx,
|  | ACG::Vec3d & | _hitPoint
| ) |  |
| private

Get closest vertex index from an edge.

Find closest vertex on the edge (endpoint)

Parameters

  _mesh | Reference to the mesh
  _edge_idx | Index of the edge that has been clicked on
  _hitPoint | The point which will be tested

Returns
  index of the closest vertex on the edge

Definition at line 696 of file MeshObjectInfoPlugin.cc.

## ◆ getClosestVertexInFace()

template<class MeshT >

int InfoMeshObjectPlugin::getClosestVertexInFace | ( | MeshT * | _mesh,
|  | int | _face_idx,
|  | ACG::Vec3d & | _hitPoint
| ) |  |
| private

Get closest vertex index from a face.

Find closest vertex to selection.

Parameters

  _mesh | Reference to the mesh
  _face_idx | Index of the face that has been clicked on
  _hitPoint | The point that is used as the reference

Returns
  index of the closest vertex of the face to the hitpoint

Definition at line 610 of file MeshObjectInfoPlugin.cc.

## ◆ maxEdgeLength

double InfoMeshObjectPlugin::maxEdgeLength | ( | int | _id | ) |
| slot

get the maximal edge length

get maximal edge length for a given object

Parameters

  _id | object id

Returns
  maximal edge length or -1 if an error occured

Definition at line 846 of file MeshObjectInfoScripting.cc.

## ◆ meanEdgeLength

double InfoMeshObjectPlugin::meanEdgeLength | ( | int | _id | ) |
| slot

get the mean edge length

get the mean edge length for a given object

Parameters

  _id | object id

Returns
  mean edge length or -1 if an error occured

Definition at line 863 of file MeshObjectInfoScripting.cc.

## ◆ minEdgeLength

double InfoMeshObjectPlugin::minEdgeLength | ( | int | _id | ) |
| slot

get the minimal edge length

get minimal edge length for a given object

Parameters

  _id | object id

Returns
  minimal edge length or -1 if an error occured

Definition at line 829 of file MeshObjectInfoScripting.cc.

## ◆ setDescriptions()

void InfoMeshObjectPlugin::setDescriptions | ( |  | ) |
| private

set scripting slot descriptions

set the descriptions for scripting slots

Definition at line 54 of file MeshObjectInfoScripting.cc.

## ◆ slotInformationRequested()

void InfoMeshObjectPlugin::slotInformationRequested | ( | const QPoint | _clickedPoint,
|  | DataType | _type
| ) |  |
| private virtual

Show information dialog on clicked object.

This slot is called each time the user clicks on an object. The information plugin for a specific type should display the necessary information on all entity types and the clicked object itself.

Parameters

  _clickedPoint | The 2D point in screen coords, which the user has clicked
  _type | Data type to be registered

Implements InformationInterface.

Definition at line 715 of file MeshObjectInfoPlugin.cc.

## ◆ supportedDataTypes()

DataType InfoMeshObjectPlugin::supportedDataTypes | ( |  | ) |
| private virtual

Get data type for information requests.

This slot is called by the core in order to identify the data types for which the plugin provides information.

Returns
  The supported data types (OR'ed in case of multiple types)

Implements InformationInterface.

Definition at line 112 of file MeshObjectInfoPlugin.cc.

## ◆ version

QString InfoMeshObjectPlugin::version | ( |  | ) |
| inline slot

set scripting slot descriptions

set the descriptions for scripting slots

Definition at line 193 of file MeshObjectInfoPlugin.hh.

## ◆ vertexCount

int InfoMeshObjectPlugin::vertexCount | ( | int | _id | ) |
| slot

get total number of vertices for a given object

Parameters

  _id | object id

Returns
  number of vertices or -1 if an error occured

Definition at line 122 of file MeshObjectInfoScripting.cc.

## ◆ vertexValence

int InfoMeshObjectPlugin::vertexValence | ( | int | _id,
|  | int | _vertexHandle
| ) |  |
| slot

get vertex valence

Parameters

  _id | id of an object
  _vertexHandle | vertex handle

Returns
  vertex valence or -1 if an error occured

Definition at line 760 of file MeshObjectInfoScripting.cc.

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

- Plugin-InfoMeshObject/MeshObjectInfoPlugin.hh
- Plugin-InfoMeshObject/MeshObjectInfoPlugin.cc
- Plugin-InfoMeshObject/MeshObjectInfoScripting.cc