Commit f680984e authored by Mike Kremer's avatar Mike Kremer

Changed info plugin to provide information on mesh objects only.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@11426 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 9ca81f34
......@@ -34,9 +34,9 @@
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* $Revision: 10745 $ *
* $LastChangedBy: moebius $ *
* $Date: 2011-01-26 10:23:50 +0100 (Wed, 26 Jan 2011) $ *
* *
\*===========================================================================*/
......@@ -51,7 +51,7 @@
#include <QtGui>
#include "InfoPlugin.hh"
#include "MeshObjectInfoPlugin.hh"
#include <iostream>
#include <ACG/GL/GLState.hh>
......@@ -88,6 +88,12 @@ void InfoPlugin::pluginsInitialized() {
//-----------------------------------------------------------------------------
DataType InfoPlugin::supportedDataTypes() {
return DataType(DATA_POLY_MESH | DATA_TRIANGLE_MESH);
}
//-----------------------------------------------------------------------------
template< class MeshT >
void InfoPlugin::printMeshInfo( MeshT* _mesh , int _id, unsigned int _face, ACG::Vec3d& _hitPoint ) {
......@@ -439,13 +445,15 @@ int InfoPlugin::getClosestEdge(MeshT* _mesh, int _face_idx) {
void
InfoPlugin::
slotMouseEventIdentify( QMouseEvent* _event ) {
if (_event->type() == QEvent::MouseButtonPress)
{
slotInformationRequested(const QPoint _clickedPoint, DataType _type) {
// Only respond on mesh objects
if((_type != DATA_TRIANGLE_MESH) && (_type != DATA_POLY_MESH)) return;
unsigned int node_idx, target_idx;
ACG::Vec3d hit_point;
if (PluginFunctions::scenegraphPick(ACG::SceneGraph::PICK_FACE, _event->pos(),node_idx, target_idx, &hit_point)) {
if (PluginFunctions::scenegraphPick(ACG::SceneGraph::PICK_FACE, _clickedPoint, node_idx, target_idx, &hit_point)) {
BaseObjectData* object;
// BaseObject* obj = dynamic_cast< BaseObject* > (object);
......@@ -465,7 +473,6 @@ InfoPlugin::
} else return;
}
}
}
//------------------------------------------------------------------------------
......
......@@ -34,9 +34,9 @@
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* $Revision: 10872 $ *
* $LastChangedBy: moebius $ *
* $Date: 2011-02-09 17:22:02 +0100 (Wed, 09 Feb 2011) $ *
* *
\*===========================================================================*/
......@@ -55,7 +55,7 @@
#include <QObject>
#include <OpenFlipper/BasePlugin/BaseInterface.hh>
#include <OpenFlipper/BasePlugin/MouseInterface.hh>
#include <OpenFlipper/BasePlugin/InformationInterface.hh>
#include <OpenFlipper/BasePlugin/StatusbarInterface.hh>
#include <OpenFlipper/BasePlugin/LoggingInterface.hh>
......@@ -73,11 +73,11 @@
Plugin to visualize information about objects in the scene
*/
class InfoPlugin : public QObject, BaseInterface, MouseInterface, LoggingInterface, StatusbarInterface
class InfoPlugin : public QObject, BaseInterface, InformationInterface, LoggingInterface, StatusbarInterface
{
Q_OBJECT
Q_INTERFACES(BaseInterface)
Q_INTERFACES(MouseInterface)
Q_INTERFACES(InformationInterface)
Q_INTERFACES(LoggingInterface)
Q_INTERFACES(StatusbarInterface)
......@@ -93,7 +93,7 @@ class InfoPlugin : public QObject, BaseInterface, MouseInterface, LoggingInterfa
// StatusbarInterface
void addWidgetToStatusbar(QWidget* _widget);
private slots :
// BaseInterface
void initializePlugin();
......@@ -102,11 +102,10 @@ class InfoPlugin : public QObject, BaseInterface, MouseInterface, LoggingInterfa
void slotObjectSelectionChanged( int _identifier );
void slotAllCleared();
// MouseInterface
void slotMouseEventIdentify( QMouseEvent* _event );
// InformationInterface
void slotInformationRequested(const QPoint _clickedPoint, DataType _type);
DataType supportedDataTypes();
public :
// default constructor
......
......@@ -34,13 +34,13 @@
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* $Revision: 10745 $ *
* $LastChangedBy: moebius $ *
* $Date: 2011-01-26 10:23:50 +0100 (Wed, 26 Jan 2011) $ *
* *
\*===========================================================================*/
#include "InfoPlugin.hh"
#include "MeshObjectInfoPlugin.hh"
#include <OpenFlipper/BasePlugin/PluginFunctions.hh>
#include <ACG/Geometry/Algorithms.hh>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment