Developer Documentation
InfoMeshObjectPlugin Class Reference

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

#include <Plugin-InfoMeshObject/MeshObjectInfoPlugin.hh>

Inheritance diagram for InfoMeshObjectPlugin:
BaseInterface InformationInterface LoggingInterface StatusbarInterface LoadSaveInterface

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 Attributes

InfoDialoginfo_
 
InfoBarinfoBar_
 
BaseObjectDatalastPickedObject_
 
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 83 of file MeshObjectInfoPlugin.hh.

Member Function Documentation

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

get the aspect ratio of a face

Parameters
_idid of an object
_faceHandleface handle
Returns
aspect ratio or -1 if an error occured

Definition at line 713 of file MeshObjectInfoScripting.cc.

int InfoMeshObjectPlugin::boundaryCount ( int  _id)
slot

get the number of boundaries for a given object

Parameters
_idobject id
Returns
number of boundaries or -1 if an error occured

Definition at line 254 of file MeshObjectInfoScripting.cc.

Vector InfoMeshObjectPlugin::boundingBoxMax ( int  _id)
slot

get maximum bounding box point

get maximum point of the (axis aligned) bounding box

Parameters
_idid of an object
Returns
maximum point of the bounding box

Definition at line 472 of file MeshObjectInfoScripting.cc.

Vector InfoMeshObjectPlugin::boundingBoxMin ( int  _id)
slot

get minumum bounding box point

get minimum point of the (axis aligned) bounding box

Parameters
_idid of an object
Returns
minimum point of the bounding box

Definition at line 422 of file MeshObjectInfoScripting.cc.

Vector InfoMeshObjectPlugin::boundingBoxSize ( int  _id)
slot

get the size of the bounding box

get the size of the (axis aligned) bounding box

Parameters
_idid of an object
Returns
size of the bounding box

Definition at line 522 of file MeshObjectInfoScripting.cc.

Vector InfoMeshObjectPlugin::cog ( int  _id)
slot

get the center of gravity

Parameters
_idid of an object
Returns
the center of gravity

Definition at line 380 of file MeshObjectInfoScripting.cc.

int InfoMeshObjectPlugin::componentCount ( int  _id)
slot

get the number of components for a given object

Parameters
_idobject id
Returns
number of components or -1 if an error occured

Definition at line 296 of file MeshObjectInfoScripting.cc.

int InfoMeshObjectPlugin::edgeCount ( int  _id)
slot

get total number of edges for a given object

Parameters
_idobject id
Returns
number of edges or -1 if an error occured

Definition at line 170 of file MeshObjectInfoScripting.cc.

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

get the length of an edge

Parameters
_idid of an object
_edgeHandleedge handle
Returns
edge length or -1 if an error occured

Definition at line 573 of file MeshObjectInfoScripting.cc.

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

get the area of a face

Parameters
_idid of an object
_faceHandleface handle
Returns
face area or -1 if an error occured

TODO implement polygonArea

Definition at line 638 of file MeshObjectInfoScripting.cc.

int InfoMeshObjectPlugin::faceCount ( int  _id)
slot

get total number of faces for a given object

Parameters
_idobject id
Returns
number of faces or -1 if an error occured

Definition at line 212 of file MeshObjectInfoScripting.cc.

int InfoMeshObjectPlugin::genus ( int  _id)
slot

get the genus of the given object

Parameters
_idid of an object
Returns
the genus

TODO this formula only works for closed objects: fix it

Definition at line 338 of file MeshObjectInfoScripting.cc.

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
_meshReference to the mesh
_face_idxIndex of the face that has been clicked on
_hitPointThe point which will be tested
Returns
index of the closest edge in the face to the hitpoint

Definition at line 627 of file MeshObjectInfoPlugin.cc.

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
_meshReference to the mesh
_edge_idxIndex of the edge that has been clicked on
_hitPointThe point which will be tested
Returns
index of the closest vertex on the edge

Definition at line 674 of file MeshObjectInfoPlugin.cc.

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
_meshReference to the mesh
_face_idxIndex of the face that has been clicked on
_hitPointThe point that is used as the reference
Returns
index of the closest vertex of the face to the hitpoint

Definition at line 588 of file MeshObjectInfoPlugin.cc.

double InfoMeshObjectPlugin::maxEdgeLength ( int  _id)
slot

get the maximal edge length

get maximal edge length for a given object

Parameters
_idobject id
Returns
maximal edge length or -1 if an error occured

Definition at line 852 of file MeshObjectInfoScripting.cc.

double InfoMeshObjectPlugin::meanEdgeLength ( int  _id)
slot

get the mean edge length

get the mean edge length for a given object

Parameters
_idobject id
Returns
mean edge length or -1 if an error occured

Definition at line 869 of file MeshObjectInfoScripting.cc.

double InfoMeshObjectPlugin::minEdgeLength ( int  _id)
slot

get the minimal edge length

get minimal edge length for a given object

Parameters
_idobject id
Returns
minimal edge length or -1 if an error occured

Definition at line 835 of file MeshObjectInfoScripting.cc.

void InfoMeshObjectPlugin::setDescriptions ( )
private

set scripting slot descriptions

set the descriptions for scripting slots

Definition at line 60 of file MeshObjectInfoScripting.cc.

void InfoMeshObjectPlugin::slotInformationRequested ( const QPoint  _clickedPoint,
DataType  _type 
)
privatevirtual

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
_clickedPointThe 2D point in screen coords, which the user has clicked
_typeData type to be registered

Implements InformationInterface.

Definition at line 693 of file MeshObjectInfoPlugin.cc.

DataType InfoMeshObjectPlugin::supportedDataTypes ( )
privatevirtual

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 122 of file MeshObjectInfoPlugin.cc.

QString InfoMeshObjectPlugin::version ( )
inlineslot

set scripting slot descriptions

set the descriptions for scripting slots

Definition at line 199 of file MeshObjectInfoPlugin.hh.

int InfoMeshObjectPlugin::vertexCount ( int  _id)
slot

get total number of vertices for a given object

Parameters
_idobject id
Returns
number of vertices or -1 if an error occured

Definition at line 128 of file MeshObjectInfoScripting.cc.

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

get vertex valence

Parameters
_idid of an object
_vertexHandlevertex handle
Returns
vertex valence or -1 if an error occured

Definition at line 766 of file MeshObjectInfoScripting.cc.


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