...
  View open merge request
Commits (1)
......@@ -6,4 +6,7 @@ endif ()
openflipper_plugin (DIRS TSplineMesh
TRANSLATION_LANGUAGES de_DE
TYPES POLYMESH TRIANGLEMESH )
TYPES POLYMESH TRIANGLEMESH
OPTDEPS OpenVolumeMesh
OPT_TYPES POLYHEDRALMESH HEXAHEDRALMESH TETRAHEDRALMESH
)
......@@ -65,6 +65,18 @@
#include "ValenceHistogramDialog.hh"
#ifdef ENABLE_POLYHEDRALMESH_SUPPORT
# include <ObjectTypes/PolyhedralMesh/PolyhedralMesh.hh>
#endif
#ifdef ENABLE_HEXAHEDRALMESH_SUPPORT
# include <ObjectTypes/HexahedralMesh/HexahedralMesh.hh>
#endif
#ifdef ENABLE_TETRAHEDRALMESH_SUPPORT
# include <ObjectTypes/TetrahedralMesh/TetrahedralMesh.hh>
#endif
#if QT_VERSION >= 0x050000
#else
#include <QtGui>
......@@ -831,6 +843,22 @@ bool InfoMeshObjectPlugin::getEdgeLengths(int _id, double &min, double &max, dou
}
//------------------------------------------------------------------------------
template<typename MeshT>
static void showVEFCCounts(const MeshT *mesh, InfoBar *infoBar) {
infoBar->vertices->setText( QLocale::system().toString( qulonglong(mesh->n_vertices()) ) );
infoBar->edges->setText( QLocale::system().toString( qulonglong(mesh->n_edges()) ) );
infoBar->faces->setText( QLocale::system().toString( qulonglong(mesh->n_faces()) ) );
infoBar->cells->setText( QLocale::system().toString( qulonglong(mesh->n_cells()) ) );
infoBar->showCounts();
}
template<typename MeshT>
static void showVEFCounts(const MeshT *mesh, InfoBar *infoBar) {
infoBar->vertices->setText( QLocale::system().toString( qulonglong(mesh->n_vertices()) ) );
infoBar->edges->setText( QLocale::system().toString( qulonglong(mesh->n_edges()) ) );
infoBar->faces->setText( QLocale::system().toString( qulonglong(mesh->n_faces()) ) );
infoBar->showCounts();
infoBar->hideCellCounts();
}
void InfoMeshObjectPlugin::updateData( int _identifier , const UpdateType& _type, const bool _deleted){
......@@ -874,29 +902,38 @@ void InfoMeshObjectPlugin::updateData( int _identifier , const UpdateType& _type
if (object && object->target() ) {
if (object->dataType(DATA_TRIANGLE_MESH)){
TriMesh* mesh = PluginFunctions::triMesh(object);
infoBar_->vertices->setText( QLocale::system().toString( qulonglong(mesh->n_vertices()) ) );
infoBar_->edges->setText( QLocale::system().toString( qulonglong(mesh->n_edges()) ) );
infoBar_->faces->setText( QLocale::system().toString( qulonglong(mesh->n_faces()) ) );
infoBar_->showCounts();
showVEFCounts(mesh, infoBar_);
return;
}
if (object->dataType(DATA_POLY_MESH)){
PolyMesh* mesh = PluginFunctions::polyMesh(object);
showVEFCounts(mesh, infoBar_);
return;
}
infoBar_->vertices->setText( QLocale::system().toString( qulonglong(mesh->n_vertices()) ) );
infoBar_->edges->setText( QLocale::system().toString( qulonglong(mesh->n_edges()) ) );
infoBar_->faces->setText( QLocale::system().toString( qulonglong(mesh->n_faces()) ) );
infoBar_->showCounts();
#ifdef ENABLE_POLYHEDRALMESH_SUPPORT
if (object->dataType(DATA_POLYHEDRAL_MESH)){
const auto mesh = PluginFunctions::polyhedralMesh(object);
showVEFCCounts(mesh, infoBar_);
return;
}
#endif
#ifdef ENABLE_HEXAHEDRALMESH_SUPPORT
if (object->dataType(DATA_HEXAHEDRAL_MESH)){
const auto mesh = PluginFunctions::hexahedralMesh(object);
showVEFCCounts(mesh, infoBar_);
return;
}
#endif
#ifdef ENABLE_TETRAHEDRALMESH_SUPPORT
if (object->dataType(DATA_TETRAHEDRAL_MESH)){
const auto mesh = PluginFunctions::tetrahedralMesh(object);
showVEFCCounts(mesh, infoBar_);
return;
}
#endif
}
......
......@@ -2,6 +2,7 @@
<qresource prefix="Plugin-InfoMeshObject">
<file>dialogIcons/bar_face.png</file>
<file>dialogIcons/bar_edge.png</file>
<file>dialogIcons/bar_cell.png</file>
<file>dialogIcons/info_aspect.png</file>
<file>dialogIcons/bar_vertex.png</file>
<file>dialogIcons/info_dihedral.png</file>
......
......@@ -62,6 +62,8 @@ void InfoBar::showCounts(){
edgesIcon->show();
faces->show();
facesIcon->show();
cells->show();
cellsIcon->show();
info->hide();
}
......@@ -72,9 +74,17 @@ void InfoBar::hideCounts(){
edgesIcon->hide();
faces->hide();
facesIcon->hide();
cells->hide();
cellsIcon->hide();
info->hide();
}
void InfoBar::hideCellCounts()
{
cells->hide();
cellsIcon->hide();
}
void InfoBar::showTargetCount(int _count){
hideCounts();
info->setText( tr("%1 targets selected").arg( _count ) );
......
......@@ -65,6 +65,7 @@ class InfoBar : public QWidget, public Ui::InfoBar
void showCounts();
void hideCounts();
void hideCellCounts();
void showTargetCount(int _count);
};
......@@ -158,6 +158,44 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="cellsIcon">
<property name="maximumSize">
<size>
<width>10</width>
<height>10</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="Plugin-InfoMeshObject.qrc">:/Plugin-InfoMeshObject/dialogIcons/bar_cell.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="cells">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>#cells</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">
......