Commit 897cb57a 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 74f82c35
......@@ -446,6 +446,9 @@ void InfoMeshObjectPlugin::printMeshInfo( MeshT* _mesh , int _id, unsigned int _
float minD = FLT_MAX;
float sumD = 0.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
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 _
typename MeshT::FaceFaceIter ff_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){
typename MeshT::Normal n2 = _mesh->normal(*ff_it);
......@@ -497,7 +501,11 @@ void InfoMeshObjectPlugin::printMeshInfo( MeshT* _mesh , int _id, unsigned int _
if (angle > maxD) maxD = angle;
sumD += angle;
numD ++;
++valence;
}
minFValence = std::min(minFValence, valence);
maxFValence = std::max(maxFValence, valence);
sumFValence += valence;
}
info_->aspectMin->setText( QString::number(minA,'f') );
......@@ -508,6 +516,9 @@ void InfoMeshObjectPlugin::printMeshInfo( MeshT* _mesh , int _id, unsigned int _
info_->angleMean->setText( "-" );
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
if ( _mesh->n_faces() > 1 ) {
......
......@@ -33,8 +33,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>739</width>
<height>1052</height>
<width>714</width>
<height>1048</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_4">
......@@ -211,8 +211,8 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
......@@ -426,8 +426,8 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
......@@ -519,8 +519,8 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
......@@ -873,8 +873,8 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>18</height>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
......@@ -901,8 +901,8 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
......@@ -977,8 +977,8 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
......@@ -992,8 +992,8 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
......@@ -1023,8 +1023,8 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
......@@ -1225,8 +1225,8 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
......@@ -1252,8 +1252,8 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>91</width>
<height>20</height>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
......@@ -1335,8 +1335,8 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
......@@ -1350,8 +1350,8 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
......@@ -1475,6 +1475,75 @@
</item>
</layout>
</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>
<layout class="QHBoxLayout" name="horizontalLayout_17">
<item>
......@@ -1758,8 +1827,8 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
<width>0</width>
<height>0</height>
</size>
</property>
</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