Commit f28d6213 authored by Mike Kremer's avatar Mike Kremer
Browse files

Added checkbox to let user decide whether to test each face's manifoldness...

Added checkbox to let user decide whether to test each face's manifoldness when loading (note: this adds additional complexity to the loading process and might cause performance loss when loading meshes with high face valence and high number of faces). Complexity: O(m*n*log(n)), m = # of faces, n = face valence.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@9825 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 39a7aac4
......@@ -83,6 +83,7 @@ FileOFFPlugin::FileOFFPlugin()
loadAlpha_(0),
loadNormals_(0),
loadTexCoords_(0),
loadCheckManifold_(0),
loadDefaultButton_(0),
userReadOptions_(0),
userWriteOptions_(0),
......@@ -657,10 +658,20 @@ bool FileOFFPlugin::parseASCII(std::istream& _in, OFFImporter& _importer, DataTy
vhandles.push_back(VertexHandle(idx));
}
if(checkDegenerateFace(vhandles)) {
fh = _importer.addFace(vhandles);
bool checkManifold = true;
if(!OpenFlipper::Options::nogui() && loadCheckManifold_ != 0) {
checkManifold = loadCheckManifold_->isChecked();
}
// Check for degenerate faces if spoecified in gui
if(checkManifold) {
if(checkDegenerateFace(vhandles)) {
fh = _importer.addFace(vhandles);
} else {
continue;
}
} else {
continue;
fh = _importer.addFace(vhandles);
}
//perhaps read face COLOR
......@@ -1272,6 +1283,9 @@ QWidget* FileOFFPlugin::loadOptionsWidget(QString /*_currentFilter*/) {
loadTexCoords_ = new QCheckBox("Load TexCoords");
layout->addWidget(loadTexCoords_);
loadCheckManifold_ = new QCheckBox("Check for manifold configurations");
layout->addWidget(loadCheckManifold_);
loadDefaultButton_ = new QPushButton("Make Default");
layout->addWidget(loadDefaultButton_);
......
......@@ -236,6 +236,7 @@ class FileOFFPlugin : public QObject, BaseInterface, FileInterface, LoadSaveInte
QCheckBox* loadAlpha_;
QCheckBox* loadNormals_;
QCheckBox* loadTexCoords_;
QCheckBox* loadCheckManifold_;
QPushButton* loadDefaultButton_;
unsigned int userReadOptions_;
......
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