From f7d360df16d141c3510a262f6b6c22c075d2b739 Mon Sep 17 00:00:00 2001 From: Jiaming Guo Date: Thu, 5 Jan 2017 12:03:09 -0600 Subject: [PATCH] resoloved conflicts --- main.cu | 53 +++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 16 deletions(-) diff --git a/main.cu b/main.cu index 6771b82..8958663 100644 --- a/main.cu +++ b/main.cu @@ -122,19 +122,38 @@ void glut_render_modelview(){ //draws the network(s) void glut_render(void) { - if(num_nets == 1){ //if a single network is loaded - glut_render_single_projection(); //fill the entire viewport - glut_render_modelview(); //set up the modelview matrix with camera details - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen - GT.glCenterline(); //render the GT network (the only one loaded) + if (ind == 0) { + if (num_nets == 1) { //if a single network is loaded + glut_render_single_projection(); //fill the entire viewport + glut_render_modelview(); //set up the modelview matrix with camera details + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen + GT.glCenterline0(); //render the GT network (the only one loaded) + } + + if (num_nets == 2) { //if two networks are loaded + + glut_render_left_projection(); //set up a projection for the left half of the window + glut_render_modelview(); //set up the modelview matrix using camera details + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen + + glEnable(GL_TEXTURE_1D); //enable texture mapping + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); //texture map will be used as the network color + glBindTexture(GL_TEXTURE_1D, cmap_tex); //bind the Brewer texture map + + GT.glCenterline(); //render the GT network + + glut_render_right_projection(); //set up a projection for the right half of the window + glut_render_modelview(); //set up the modelview matrix using camera details + T.glCenterline(); //render the T network + } } - else{ - if(num_nets == 1){ //if a single network is loaded + else { + if (num_nets == 1) { //if a single network is loaded std::cout << "You should have at least two networks to do mapping." << std::endl; //exit program because there isn't enough network exit(1); } - if(num_nets == 2){ //if two networks are loaded - if(compareMode){ + if (num_nets == 2) { //if two networks are loaded + if (compareMode) { glut_render_left_projection(); //set up a projection for the left half of the window glut_render_modelview(); //set up the modelview matrix using camera details glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen @@ -149,11 +168,13 @@ void glut_render(void) { glut_render_modelview(); //set up the modelview matrix using camera details _T.glCenterline(); //render the T network - GT.glCenterline(); //render the GT network + } + else { + glut_render_left_projection(); //set up a projection for the left half of the window + glut_render_modelview(); //set up the modelview matrix using camera details + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen - glut_render_right_projection(); //set up a projection for the right half of the window - glut_render_modelview(); //set up the modelview matrix using camera details - T.glCenterline(); //render the T network + _GT.glRandColorCenterlineGT(dlist1, _gt_t, colormap); glut_render_right_projection(); //set up a projection for the right half of the window glut_render_modelview(); //set up the modelview matrix using camera details @@ -162,7 +183,7 @@ void glut_render(void) { } } - if(num_nets == 2){ + if (num_nets == 2) { std::ostringstream ss; if (mappingMode) // if it is in mapping mode ss << "Mapping Mode"; @@ -183,8 +204,8 @@ void glut_render(void) { glPushMatrix(); glLoadIdentity(); - glRasterPos2f(0, 5); //print text in the bottom left corner - glutBitmapString(GLUT_BITMAP_TIMES_ROMAN_24, (const unsigned char*)(ss.str().c_str())); + glRasterPos2f(0, 5); //print text in the bottom left corner + glutBitmapString(GLUT_BITMAP_TIMES_ROMAN_24, (const unsigned char*)(ss.str().c_str())); glPopMatrix(); glMatrixMode(GL_PROJECTION); -- libgit2 0.21.4