#include "rtsFilamentNetwork.h" int rtsFilamentNetwork::LoadFIB(const char* filename) { return fib_load(filename); } int rtsFilamentNetwork::fib_load(const char* filename) { //open the input file ifstream infile; infile.open(filename); if(!infile) return 0; //temporary vector storing points vector> vertices; vector radii; point3D input; point3D max(0.0, 0.0, 0.0); //maximum extents of the points in the file float r; int i,j; //get all of the nodes from the file int num_nodes; infile>>num_nodes; int id; for(i=0; i>id; infile>>input.x; infile>>input.y; infile>>input.z; infile>>r; //update the maximum if(input.x > max.x) max.x = input.x; if(input.y > max.y) max.y = input.y; if(input.z > max.z) max.z = input.z; vertices.push_back(input); radii.push_back(r); } /*Scale the node values based on the maximum value. I do this so that every node is between 0 - 1 rather than the original scale. In the long run, it should make rendering easier. */ for(i=0; i>num_filaments; for(i=0; iobjBegin(OBJ_LINE_STRIP); //begin the filament infile>>num_edges; for(j = 1; j>id; id--; network->objVertex3f(vertices[id].x, vertices[id].y, vertices[id].z); //this final read is required because of redundancy in the input file infile>>id; } infile>>id; //this final read is also required due to redundancy in the input file id--; network->objVertex3f(vertices[id].x, vertices[id].y, vertices[id].z); infile>>id; id--; network->objVertex3f(vertices[id].x, vertices[id].y, vertices[id].z); network->objEnd(); } return 1; } void rtsFilamentNetwork::PrintProperties() { cout<<"Number of Filaments: "<getNumLines(); } void rtsFilamentNetwork::PrintNetwork() { }