Commit 4cf7cf5d authored by Hans-Christian Ebke's avatar Hans-Christian Ebke

Plugin-InfoMeshObject: Added face valence info. (Important for PolyMeshes.)


git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@18772 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 0d91588b
...@@ -446,6 +446,9 @@ void InfoMeshObjectPlugin::printMeshInfo( MeshT* _mesh , int _id, unsigned int _ ...@@ -446,6 +446,9 @@ void InfoMeshObjectPlugin::printMeshInfo( MeshT* _mesh , int _id, unsigned int _
float minD = FLT_MAX; float minD = FLT_MAX;
float sumD = 0.0; float sumD = 0.0;
int numD = 0; int numD = 0;
unsigned int maxFValence = -std::numeric_limits<float>::infinity();
unsigned int minFValence = std::numeric_limits<float>::infinity();
size_t sumFValence = 0;
//iterate over all faces //iterate over all faces
for (f_it = _mesh->faces_begin(); f_it != f_end; ++f_it){ for (f_it = _mesh->faces_begin(); f_it != f_end; ++f_it){
...@@ -487,6 +490,7 @@ void InfoMeshObjectPlugin::printMeshInfo( MeshT* _mesh , int _id, unsigned int _ ...@@ -487,6 +490,7 @@ void InfoMeshObjectPlugin::printMeshInfo( MeshT* _mesh , int _id, unsigned int _
typename MeshT::FaceFaceIter ff_it; typename MeshT::FaceFaceIter ff_it;
typename MeshT::Normal n1 = _mesh->normal(*f_it); typename MeshT::Normal n1 = _mesh->normal(*f_it);
unsigned int valence = 0;
for (ff_it = _mesh->ff_iter(*f_it); ff_it.is_valid(); ++ff_it){ for (ff_it = _mesh->ff_iter(*f_it); ff_it.is_valid(); ++ff_it){
typename MeshT::Normal n2 = _mesh->normal(*ff_it); typename MeshT::Normal n2 = _mesh->normal(*ff_it);
...@@ -497,7 +501,11 @@ void InfoMeshObjectPlugin::printMeshInfo( MeshT* _mesh , int _id, unsigned int _ ...@@ -497,7 +501,11 @@ void InfoMeshObjectPlugin::printMeshInfo( MeshT* _mesh , int _id, unsigned int _
if (angle > maxD) maxD = angle; if (angle > maxD) maxD = angle;
sumD += angle; sumD += angle;
numD ++; numD ++;
++valence;
} }
minFValence = std::min(minFValence, valence);
maxFValence = std::max(maxFValence, valence);
sumFValence += valence;
} }
info_->aspectMin->setText( QString::number(minA,'f') ); info_->aspectMin->setText( QString::number(minA,'f') );
...@@ -508,6 +516,9 @@ void InfoMeshObjectPlugin::printMeshInfo( MeshT* _mesh , int _id, unsigned int _ ...@@ -508,6 +516,9 @@ void InfoMeshObjectPlugin::printMeshInfo( MeshT* _mesh , int _id, unsigned int _
info_->angleMean->setText( "-" ); info_->angleMean->setText( "-" );
info_->angleMax->setText( QString::number(maxI,'f') ); info_->angleMax->setText( QString::number(maxI,'f') );
info_->faceValenceMin->setText(trUtf8("%1").arg(minFValence));
info_->faceValenceMax->setText(trUtf8("%1").arg(maxFValence));
info_->faceValenceMean->setText(trUtf8("%1").arg(sumFValence / _mesh->n_faces()));
// Only one face or no face -> don't output angles // Only one face or no face -> don't output angles
if ( _mesh->n_faces() > 1 ) { if ( _mesh->n_faces() > 1 ) {
......
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>739</width> <width>714</width>
<height>1052</height> <height>1048</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout_4"> <layout class="QGridLayout" name="gridLayout_4">
...@@ -211,8 +211,8 @@ ...@@ -211,8 +211,8 @@
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>40</width> <width>0</width>
<height>20</height> <height>0</height>
</size> </size>
</property> </property>
</spacer> </spacer>
...@@ -426,8 +426,8 @@ ...@@ -426,8 +426,8 @@
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>40</width> <width>0</width>
<height>20</height> <height>0</height>
</size> </size>
</property> </property>
</spacer> </spacer>
...@@ -519,8 +519,8 @@ ...@@ -519,8 +519,8 @@
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>40</width> <width>0</width>
<height>20</height> <height>0</height>
</size> </size>
</property> </property>
</spacer> </spacer>
...@@ -873,8 +873,8 @@ ...@@ -873,8 +873,8 @@
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>0</width>
<height>18</height> <height>0</height>
</size> </size>
</property> </property>
</spacer> </spacer>
...@@ -901,8 +901,8 @@ ...@@ -901,8 +901,8 @@
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>40</width> <width>0</width>
<height>20</height> <height>0</height>
</size> </size>
</property> </property>
</spacer> </spacer>
...@@ -977,8 +977,8 @@ ...@@ -977,8 +977,8 @@
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>40</width> <width>0</width>
<height>20</height> <height>0</height>
</size> </size>
</property> </property>
</spacer> </spacer>
...@@ -992,8 +992,8 @@ ...@@ -992,8 +992,8 @@
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>0</width>
<height>40</height> <height>0</height>
</size> </size>
</property> </property>
</spacer> </spacer>
...@@ -1023,8 +1023,8 @@ ...@@ -1023,8 +1023,8 @@
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>40</width> <width>0</width>
<height>20</height> <height>0</height>
</size> </size>
</property> </property>
</spacer> </spacer>
...@@ -1225,8 +1225,8 @@ ...@@ -1225,8 +1225,8 @@
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>40</width> <width>0</width>
<height>20</height> <height>0</height>
</size> </size>
</property> </property>
</spacer> </spacer>
...@@ -1252,8 +1252,8 @@ ...@@ -1252,8 +1252,8 @@
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>91</width> <width>0</width>
<height>20</height> <height>0</height>
</size> </size>
</property> </property>
</spacer> </spacer>
...@@ -1335,8 +1335,8 @@ ...@@ -1335,8 +1335,8 @@
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>40</width> <width>0</width>
<height>20</height> <height>0</height>
</size> </size>
</property> </property>
</spacer> </spacer>
...@@ -1350,8 +1350,8 @@ ...@@ -1350,8 +1350,8 @@
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>0</width>
<height>40</height> <height>0</height>
</size> </size>
</property> </property>
</spacer> </spacer>
...@@ -1475,6 +1475,75 @@ ...@@ -1475,6 +1475,75 @@
</item> </item>
</layout> </layout>
</item> </item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_23">
<item>
<widget class="QLabel" name="label_16">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Face Valence:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="verticesIcon_7">
<property name="minimumSize">
<size>
<width>0</width>
<height>32</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="faceValenceMin">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>min</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="faceValenceMean">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>mean</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="faceValenceMax">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>max</string>
</property>
</widget>
</item>
</layout>
</item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_17"> <layout class="QHBoxLayout" name="horizontalLayout_17">
<item> <item>
...@@ -1758,8 +1827,8 @@ ...@@ -1758,8 +1827,8 @@
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>40</width> <width>0</width>
<height>20</height> <height>0</height>
</size> </size>
</property> </property>
</spacer> </spacer>
......
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