Commit 8f2e7f18 authored by Vladimír Ulman's avatar Vladimír Ulman
Browse files

Tries to load up to 100 filopodia VTKs per time-point

(which is a consequence of the new plan between GM and TM
that filopodia VTKs may not use sequential numbers in their
filenames... hence, if 04 fails to load, we cannot assume that
there is no 05..).
parent cbc9259f
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -74,13 +74,16 @@ int main(int argc,char **argv)
		std::cout << "tetrahedra #: " << mesh.VolID.size()/4 << "\n";
		std::cout << "normals    #: " << mesh.norm.size() << "\n";

		std::cout << "filopodia #: " << mesh.Ftree.size() << "\n";
		//std::cout << "filopodia #: " << mesh.Ftree.size() << "\n";
		for (size_t f=0; f < mesh.Ftree.size(); ++f)
		{
			if (mesh.Ftree[f].Pos.size() > 0)
			{
				std::cout << f << ": vertices  #: " << mesh.Ftree[f].Pos.size() << "\n";
				std::cout << f << ": triangles #: " << mesh.Ftree[f].ID.size()/3 << "\n";
				std::cout << f << ": normals   #: " << mesh.Ftree[f].norm.size() << "\n";
			}
		}

		//update the current bounding box
		if (i == ii)
@@ -205,10 +208,11 @@ bool LoadNewMesh(const char* path,const int ID,const int fileNo)
	{
		++filoNo;
		sprintf(fn,"%s/ID%d/ID%d_t%03d_fTree%02d.vtk",path,ID,ID,fileNo,filoNo);
		std::cout << "reading filopodium: " << fn << "\n";

		retval=mesh.ImportVTK_Ftree(fn,999999);
	} while (retval == 0);
		if (retval != 1) std::cout << "reading filopodium: " << fn << "\n";
	} while (retval < 2 && filoNo < 100);
	//NB: retval == 0 when read successfully; == 1 when file open error

	//report errors except for "cannot open file"
	if (retval > 1) 
@@ -220,7 +224,7 @@ bool LoadNewMesh(const char* path,const int ID,const int fileNo)
	//remove last filopodium mesh (which is usually empty...)
	mesh.DiscardLastEmptyFilopodiumObject();

	std::cout << "loaded mesh #" << fileNo << " (with " << filoNo-1 << " filopodia)\n";
	std::cout << "loaded mesh #" << fileNo << "\n";

	//keep (by rotating) vertex positions
	mesh.RotateVolPos();
+11 −7
Original line number Diff line number Diff line
@@ -99,14 +99,17 @@ int main(int argc,char **argv)
		std::cout << "triangles  #: " << mesh.ID.size()/3 << "\n";
		std::cout << "normals    #: " << mesh.norm.size() << "\n";

		std::cout << "filopodia #: " << mesh.Ftree.size() << "\n";
		//std::cout << "filopodia #: " << mesh.Ftree.size() << "\n";
		for (size_t f=0; f < mesh.Ftree.size(); ++f)
		{
			if (mesh.Ftree[f].Pos.size() > 0)
			{
				std::cout << f << ": vertices  #: " << mesh.Ftree[f].Pos.size() << "\n";
				std::cout << f << ": triangles #: " << mesh.Ftree[f].ID.size()/3 << "\n";
				std::cout << f << ": normals   #: " << mesh.Ftree[f].norm.size() << "\n";
			}
		}
	}

	//position the mesh with its centre aligned with the scene centre
	mesh.CenterMesh();
@@ -195,10 +198,11 @@ bool LoadNewMesh(const char* path,const int ID,const int fileNo)
	{
		++filoNo;
		sprintf(fn,"%s/ID%d/ID%d_t%03d_fTree%02d.vtk",path,ID,ID,fileNo,filoNo);
		std::cout << "reading filopodium: " << fn << "\n";

		retval=mesh.ImportVTK_Ftree(fn,999999);
	} while (retval == 0);
		if (retval != 1) std::cout << "reading filopodium: " << fn << "\n";
	} while (retval < 2 && filoNo < 100);
	//NB: retval == 0 when read successfully; == 1 when file open error

	//report errors except for "cannot open file"
	if (retval > 1) 
@@ -210,7 +214,7 @@ bool LoadNewMesh(const char* path,const int ID,const int fileNo)
	//remove last filopodium mesh (which is usually empty...)
	mesh.DiscardLastEmptyFilopodiumObject();

	std::cout << "loaded mesh #" << fileNo << " (with " << filoNo-1 << " filopodia)\n";
	std::cout << "loaded mesh #" << fileNo << "\n";

	return(true);
}