From 737784081aa3de7ed0b8113f8d24f20f388b7855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Thu, 20 May 2010 13:32:22 +0000 Subject: [PATCH] Don't output dihedral angles for no or one face git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@9359 383ad7c9-94d9-4d36-a494-682f7c89f535 --- Plugin-Info/InfoPlugin.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Plugin-Info/InfoPlugin.cc b/Plugin-Info/InfoPlugin.cc index 6dc86481a..3ffbb28d7 100644 --- a/Plugin-Info/InfoPlugin.cc +++ b/Plugin-Info/InfoPlugin.cc @@ -271,9 +271,17 @@ void InfoPlugin::printMeshInfo( MeshT* _mesh , int _id, unsigned int _face, ACG: info_->angleMean->setText( "-" ); info_->angleMax->setText( QString::number(maxI,'f') ); - info_->dihedralMin->setText( QString::number(minD,'f') ); - info_->dihedralMean->setText( QString::number( sumD / (_mesh->n_faces()*3),'f' ) ); - info_->dihedralMax->setText( QString::number(maxD,'f') ); + + // Only one face or no face -> don't output angles + if ( _mesh->n_faces() > 1 ) { + info_->dihedralMin->setText( QString::number(minD,'f') ); + info_->dihedralMean->setText( QString::number( sumD / (_mesh->n_faces()*3),'f' ) ); + info_->dihedralMax->setText( QString::number(maxD,'f') ); + } else { + info_->dihedralMin->setText( "-" ); + info_->dihedralMean->setText( "-" ); + info_->dihedralMax->setText( "-" ); + } typename MeshT::FaceHandle fh = _mesh->face_handle(_face); -- GitLab