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

ADD: The Generator accepts the config file as its first parameter, and parses it.

It, however, does not make any use of it, currently...
parent e69f9e04
Loading
Loading
Loading
Loading
+18 −12
Original line number Diff line number Diff line
@@ -59,11 +59,11 @@ int RenderMesh(const char* path,const int ID,int fileNo);

int main(int argc,char **argv)
{
	if (argc != 4 && argc != 5 && argc != 6)
	if (argc != 5 && argc != 6 && argc != 7)
	{
		//I'm executed with no params, provide help
		std::cout << "ADD SOME HEADER INFORMATION HERE\n\n";
		std::cout << "params:  path_to_VTKs path_to_output  dataset_ID  [time_point] [no_of_time_points]\n\n";
		std::cout << "params:  config_file  path_to_VTKs path_to_output  dataset_ID  [time_point] [no_of_time_points]\n\n";
		std::cout << "The program will try to load object files (cell body volumetric mesh and\n"
                   "filopodia skeleton definition) iteratively (starting from 0th time point)\n"
                   "until it fails loading cell body file. Filopodia files for the current time\n"
@@ -73,15 +73,21 @@ int main(int argc,char **argv)
		return(-1);
	}

	//process the config file
	if (mesh.configFile.ParseConfigFile(argv[1]) != 0) return(-2);
	//access the config params as, e.g. :
	// mesh.configFile.texture_Resolution.x
	return(0);

	//determine the first time point to start with
	int i=0;
	if (argc >= 5) i=atoi(argv[4]);
	if (argc >= 6) i=atoi(argv[5]);

	int framesToGoHome=999999999;
	if (argc == 6) framesToGoHome=atoi(argv[5]);
	if (argc == 7) framesToGoHome=atoi(argv[6]);

	//get dataset ID
	int ID=atoi(argv[3]);
	int ID=atoi(argv[4]);

	//I'm called as generator/simulator, init the situation...
	ParamsSetup();
@@ -92,7 +98,7 @@ int main(int argc,char **argv)
	int fframesToGoHome(framesToGoHome); //how many indices to read
	Vector3F minBB,maxBB;                //bounding box corners

	while ((fframesToGoHome > 0) && LoadNewMesh(argv[1],ID,ii))
	while ((fframesToGoHome > 0) && LoadNewMesh(argv[2],ID,ii))
	{
		std::cout << "mesh: #" << ii << "\n";
		std::cout << "vertices   #: " << mesh.Pos.size() << "\n";
@@ -141,18 +147,18 @@ int main(int argc,char **argv)
	          << maxBB.x << "," << maxBB.y << "," << maxBB.z << "] in microns\n";

	std::cout << "SECOND RUN: reading all meshes to conduct the texture simulation and rendering.\n";
	while ((framesToGoHome > 0) && LoadNewMesh(argv[1],ID,i,true))
	while ((framesToGoHome > 0) && LoadNewMesh(argv[2],ID,i,true))
	{
		RenderMesh(argv[2],ID,i);
		RenderMesh(argv[3],ID,i);
		++i;
		--framesToGoHome;
	}

	//report the tip trajectories
	char fileName[1024];
	sprintf(fileName,"%s/ID%d_afterTM/tip_trajectories_pxOffsets.txt",argv[2],ID);
	sprintf(fileName,"%s/ID%d_afterTM/tip_trajectories_pxOffsets.txt",argv[3],ID);
	std::ofstream oFile(fileName);
	sprintf(fileName,"%s/ID%d_afterTM/tip_trajectories_umCoords.txt",argv[2],ID);
	sprintf(fileName,"%s/ID%d_afterTM/tip_trajectories_umCoords.txt",argv[3],ID);
	std::ofstream cFile(fileName);

	std::map<int,timeVector>::const_iterator tipIter=tipOffsets.begin();
@@ -175,9 +181,9 @@ int main(int argc,char **argv)
	cFile.close();

	//report the cell centre coordinates
	sprintf(fileName,"%s/ID%d_afterTM/centre_trajectories_pxOffsets.txt",argv[2],ID);
	sprintf(fileName,"%s/ID%d_afterTM/centre_trajectories_pxOffsets.txt",argv[3],ID);
	std::ofstream OFile(fileName);
	sprintf(fileName,"%s/ID%d_afterTM/centre_trajectories_umCoords.txt",argv[2],ID);
	sprintf(fileName,"%s/ID%d_afterTM/centre_trajectories_umCoords.txt",argv[3],ID);
	std::ofstream CFile(fileName);

	OFile << "1:";