Commit 49f9ce4a authored by Mike Kremer's avatar Mike Kremer

Moved Plugin-Info to Plugin-InfoMeshObject

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@11427 383ad7c9-94d9-4d36-a494-682f7c89f535
parents
include (plugin)
if (EXISTS ${CMAKE_SOURCE_DIR}/ObjectTypes/TSplineMesh)
add_definitions (-DENABLE_TSPLINEMESH_SUPPORT)
endif ()
openflipper_plugin (DIRS TSplineMesh TRANSLATION_LANGUAGES de_DE)
This diff is collapsed.
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (C) 2001-2011 by Computer Graphics Group, RWTH Aachen *
* www.openflipper.org *
* *
*--------------------------------------------------------------------------- *
* This file is part of OpenFlipper. *
* *
* OpenFlipper is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of *
* the License, or (at your option) any later version with the *
* following exceptions: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* OpenFlipper is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU LesserGeneral Public *
* License along with OpenFlipper. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision: 10872 $ *
* $LastChangedBy: moebius $ *
* $Date: 2011-02-09 17:22:02 +0100 (Wed, 09 Feb 2011) $ *
* *
\*===========================================================================*/
//=============================================================================
//
// CLASS InfoPlugin
//
// Author: David Bommes <bommes@cs.rwth-aachen.de>
//=============================================================================
#ifndef INFOPLUGIN_HH
#define INFOPLUGIN_HH
//== INCLUDES =================================================================
#include <QObject>
#include <OpenFlipper/BasePlugin/BaseInterface.hh>
#include <OpenFlipper/BasePlugin/InformationInterface.hh>
#include <OpenFlipper/BasePlugin/StatusbarInterface.hh>
#include <OpenFlipper/BasePlugin/LoggingInterface.hh>
#include <OpenFlipper/common/Types.hh>
#include <ObjectTypes/PolyMesh/PolyMesh.hh>
#include <ObjectTypes/TriangleMesh/TriangleMesh.hh>
#include "infoDialog.hh"
#include "infoBar.hh"
//== CLASS DEFINITION =========================================================
/** \brief Plugin to visualize information about objects in the scene
Plugin to visualize information about objects in the scene
*/
class InfoPlugin : public QObject, BaseInterface, InformationInterface, LoggingInterface, StatusbarInterface
{
Q_OBJECT
Q_INTERFACES(BaseInterface)
Q_INTERFACES(InformationInterface)
Q_INTERFACES(LoggingInterface)
Q_INTERFACES(StatusbarInterface)
signals:
// BaseInterface
void setSlotDescription(QString _slotName, QString _slotDescription,
QStringList _parameters, QStringList _descriptions);
// LoggingInterface
void log(Logtype _type, QString _message);
void log(QString _message);
// StatusbarInterface
void addWidgetToStatusbar(QWidget* _widget);
private slots :
// BaseInterface
void initializePlugin();
void pluginsInitialized();
void slotObjectUpdated( int _identifier, const UpdateType _type );
void slotObjectSelectionChanged( int _identifier );
void slotAllCleared();
// InformationInterface
void slotInformationRequested(const QPoint _clickedPoint, DataType _type);
DataType supportedDataTypes();
public :
// default constructor
InfoPlugin(): info_(0),infoBar_(0) {};
// default destructor
~InfoPlugin() {};
/// Name of the Plugin
QString name(){ return (QString("Info")); };
/// Description of the Plugin
QString description() { return (QString(tr("Providing Information about Objects"))); };
private :
InfoDialog* info_;
InfoBar* infoBar_;
template< class MeshT >
void printMeshInfo( MeshT* _mesh, int _id, unsigned int _face, ACG::Vec3d& _hitPoint );
//===========================================================================
/** @name Scripting Functions
* @{ */
//===========================================================================
public slots:
/// get total number of vertices for a given object
int vertexCount(int _id);
/// get total number of edges for a given object
int edgeCount(int _id);
/// get total number of faces for a given object
int faceCount(int _id);
/// get the number of boundaries for a given object
int boundaryCount(int _id);
/// get the number of components for a given object
int componentCount(int _id);
/// get the genus of the given object
int genus(int _id);
/// get the center of gravity
Vector cog(int _id);
/// get minumum bounding box point
Vector boundingBoxMin(int _id);
/// get maximum bounding box point
Vector boundingBoxMax(int _id);
/// get the size of the bounding box
Vector boundingBoxSize(int _id);
/// get the length of an edge
double edgeLength(int _id, int _edgeHandle);
/// get the area of a face
double faceArea (int _id, int _faceHandle);
/// get the aspect ratio of a face
double aspectRatio(int _id, int _faceHandle);
/// get vertex valence
int vertexValence (int _id, int _vertexHandle);
/// get the minimal edge length
double minEdgeLength(int _id);
/// get the maximal edge length
double maxEdgeLength(int _id);
/// get the mean edge length
double meanEdgeLength(int _id);
public slots:
QString version() { return QString("1.0"); };
private:
/// set scripting slot descriptions
void setDescriptions();
/// Get closest vertex index
template< class MeshT >
int getClosestVertex(MeshT* _mesh, int _face_idx);
/// Get closest edge index
template< class MeshT >
int getClosestEdge(MeshT* _mesh, int _face_idx);
/// Get edge lengths
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);
/// Mouse click hit point on face
ACG::Vec3d hit_point_;
/** @} */
};
#endif //MOVEPLUGIN_HH
This diff is collapsed.
<RCC>
<qresource prefix="info" >
<file>dialogIcons/bar_face.png</file>
<file>dialogIcons/bar_edge.png</file>
<file>dialogIcons/info_aspect.png</file>
<file>dialogIcons/bar_vertex.png</file>
<file>dialogIcons/info_dihedral.png</file>
<file>dialogIcons/info_edge.png</file>
<file>dialogIcons/info_angle.png</file>
<file>dialogIcons/info_valence.png</file>
<file>dialogIcons/info_boundaries.png</file>
<file>dialogIcons/info_boundingbox.png</file>
<file>dialogIcons/info_bracketA.png</file>
<file>dialogIcons/info_bracketB.png</file>
<file>dialogIcons/info_components.png</file>
<file>dialogIcons/info_edges.png</file>
<file>dialogIcons/info_faces.png</file>
<file>dialogIcons/info_genus.png</file>
<file>dialogIcons/info_vertices.png</file>
</qresource>
</RCC>
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (C) 2001-2011 by Computer Graphics Group, RWTH Aachen *
* www.openflipper.org *
* *
*--------------------------------------------------------------------------- *
* This file is part of OpenFlipper. *
* *
* OpenFlipper is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of *
* the License, or (at your option) any later version with the *
* following exceptions: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* OpenFlipper is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU LesserGeneral Public *
* License along with OpenFlipper. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
#include "infoBar.hh"
#include <QtGui>
InfoBar::InfoBar(QWidget *parent)
: QWidget(parent)
{
setupUi(this);
}
void InfoBar::showCounts(){
vertices->show();
verticesIcon->show();
edges->show();
edgesIcon->show();
faces->show();
facesIcon->show();
info->hide();
}
void InfoBar::hideCounts(){
vertices->hide();
verticesIcon->hide();
edges->hide();
edgesIcon->hide();
faces->hide();
facesIcon->hide();
info->hide();
}
void InfoBar::showTargetCount(int _count){
hideCounts();
info->setText( tr("%1 targets selected").arg( _count ) );
info->show();
}
\ No newline at end of file
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (C) 2001-2011 by Computer Graphics Group, RWTH Aachen *
* www.openflipper.org *
* *
*--------------------------------------------------------------------------- *
* This file is part of OpenFlipper. *
* *
* OpenFlipper is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of *
* the License, or (at your option) any later version with the *
* following exceptions: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* OpenFlipper is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU LesserGeneral Public *
* License along with OpenFlipper. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
#include "ui_infoBar.hh"
#include <QtGui>
class InfoBar : public QWidget, public Ui::InfoBar
{
Q_OBJECT
public:
InfoBar(QWidget *parent = 0);
void showCounts();
void hideCounts();
void showTargetCount(int _count);
};
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>InfoBar</class>
<widget class="QWidget" name="InfoBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>235</width>
<height>16</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>16</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="verticesIcon">
<property name="maximumSize">
<size>
<width>10</width>
<height>10</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="icons.qrc">:/info/dialogIcons/bar_vertex.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="vertices">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>#vertex</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="margin">
<number>2</number>
</property>
<property name="indent">
<number>10</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="edgesIcon">
<property name="maximumSize">
<size>
<width>10</width>
<height>10</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="icons.qrc">:/info/dialogIcons/bar_edge.png</pixmap>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
<property name="indent">
<number>-1</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="edges">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>#edges</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="margin">
<number>2</number>
</property>
<property name="indent">
<number>10</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="facesIcon">
<property name="maximumSize">
<size>
<width>10</width>
<height>10</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="icons.qrc">:/info/dialogIcons/bar_face.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="faces">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>#faces</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="margin">
<number>2</number>
</property>
<property name="indent">
<number>10</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="info">
<property name="text">
<string>info</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="icons.qrc"/>
</resources>
<connections/>
</ui>
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (C) 2001-2011 by Computer Graphics Group, RWTH Aachen *
* www.openflipper.org *
* *
*--------------------------------------------------------------------------- *
* This file is part of OpenFlipper. *
* *
* OpenFlipper is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of *
* the License, or (at your option) any later version with the *
* following exceptions: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* OpenFlipper is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU LesserGeneral Public *
* License along with OpenFlipper. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
#include "infoDialog.hh"
#include <QtGui>
InfoDialog::InfoDialog(QWidget *parent)
: QDialog(parent)
{
setupUi(this);
}
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (C) 2001-2011 by Computer Graphics Group, RWTH Aachen *
* www.openflipper.org *
* *
*--------------------------------------------------------------------------- *
* This file is part of OpenFlipper. *
* *
* OpenFlipper is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of *
* the License, or (at your option) any later version with the *
* following exceptions: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* OpenFlipper is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU LesserGeneral Public *
* License along with OpenFlipper. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
#include "ui_infoWidget.hh"
#include <QtGui>
class InfoDialog : public QDialog, public Ui::InfoWidget
{
Q_OBJECT
public:
InfoDialog(QWidget *parent = 0);
};
This diff is collapsed.
This diff is collapsed.
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