Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 32121895 authored by soniayukiselmi's avatar soniayukiselmi
Browse files

FIXED bug reading off file (missing first element)

git-svn-id: svn+ssh://scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/svn/camitk/trunk/camitk@532 ec899d31-69d1-42ba-9299-647d76f65fb3
parent b1376388
......@@ -82,7 +82,7 @@ OffComponent::OffComponent(const QString & file) throw(AbortException) : MeshCom
nbElements = nbPolygon;
nbPoints = nbVertex;
while(!std::getline(inputFile, line).eof() && countVertex<nbPoints) {
while(std::getline(inputFile, line) && countVertex<nbPoints) {
std::istringstream stream(line, std::istringstream::in);
if (line.compare("#")!=0) {
......@@ -101,7 +101,7 @@ OffComponent::OffComponent(const QString & file) throw(AbortException) : MeshCom
vtkIdType pts[3];
int elemCount = 0;
while (!std::getline(inputFile, line).eof() && elemCount<nbElements) {
do {
std::istringstream stream(line, std::istringstream::in);
if (line.compare("#")!=0) {
......@@ -113,7 +113,7 @@ OffComponent::OffComponent(const QString & file) throw(AbortException) : MeshCom
polys->InsertNextCell(eltType,pts); // add the element to the vtkCellArray
++elemCount;
}
}
} while (std::getline(inputFile, line) && elemCount<nbElements);
offMesh->SetPolys(polys);
......
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