Commit 09cb5950f628309ac65c6b85119d3f16e5bcd0a2
1 parent
3a4a7f69
fixed some comments, there is still a bug in the gl_network.h
Showing
1 changed file
with
20 additions
and
19 deletions
Show diff stats
main.cu
@@ -24,33 +24,33 @@ | @@ -24,33 +24,33 @@ | ||
24 | 24 | ||
25 | //visualization objects | 25 | //visualization objects |
26 | stim::gl_aaboundingbox<float> bb; //axis-aligned bounding box object | 26 | stim::gl_aaboundingbox<float> bb; //axis-aligned bounding box object |
27 | -stim::camera cam; //camera object | 27 | +stim::camera cam; //camera object |
28 | 28 | ||
29 | // number of networks | 29 | // number of networks |
30 | unsigned num_nets = 0; | 30 | unsigned num_nets = 0; |
31 | 31 | ||
32 | // networks | 32 | // networks |
33 | -stim::gl_network<float> GT; //ground truth network | ||
34 | -stim::gl_network<float> T; //test network | ||
35 | -stim::gl_network<float> _GT; //splitted GT | ||
36 | -stim::gl_network<float> _T; //splitted T | 33 | +stim::gl_network<float> GT; //ground truth network |
34 | +stim::gl_network<float> T; //test network | ||
35 | +stim::gl_network<float> _GT; //splitted GT | ||
36 | +stim::gl_network<float> _T; //splitted T | ||
37 | 37 | ||
38 | // indicator | 38 | // indicator |
39 | -unsigned ind = 0; //indicator of mapping | 39 | +unsigned ind = 0; //indicator of mapping |
40 | 40 | ||
41 | // relationships | 41 | // relationships |
42 | -std::vector<unsigned> _gt_t; // store indices of nearest edge points in _T for _GT | ||
43 | -std::vector<unsigned> _t_gt; // store indices of nearest edge points in _GT for _T | 42 | +std::vector<unsigned> _gt_t; // store indices of nearest edge points in _T for _GT |
43 | +std::vector<unsigned> _t_gt; // store indices of nearest edge points in _GT for _T | ||
44 | 44 | ||
45 | //hard-coded parameters | 45 | //hard-coded parameters |
46 | -float resample_rate = 0.5f; //sample rate for the network (fraction of sigma used as the maximum sample rate) | ||
47 | -float camera_factor = 1.2f; //start point of the camera as a function of X and Y size | ||
48 | -float orbit_factor = 0.01f; //degrees per pixel used to orbit the camera | 46 | +float resample_rate = 0.5f; //sample rate for the network (fraction of sigma used as the maximum sample rate) |
47 | +float camera_factor = 1.2f; //start point of the camera as a function of X and Y size | ||
48 | +float orbit_factor = 0.01f; //degrees per pixel used to orbit the camera | ||
49 | float zoom_factor = 10.0f; | 49 | float zoom_factor = 10.0f; |
50 | float radius_factor = 0.5f; | 50 | float radius_factor = 0.5f; |
51 | 51 | ||
52 | //mouse click | 52 | //mouse click |
53 | -bool LButtonDown = false; // true when left button down | 53 | +bool LButtonDown = false; // true when left button down |
54 | bool RButtonDown = false; | 54 | bool RButtonDown = false; |
55 | 55 | ||
56 | //mouse position tracking | 56 | //mouse position tracking |
@@ -58,7 +58,7 @@ int mouse_x; | @@ -58,7 +58,7 @@ int mouse_x; | ||
58 | int mouse_y; | 58 | int mouse_y; |
59 | 59 | ||
60 | // render modes | 60 | // render modes |
61 | -bool compareMode = true; // default mode is compare mode | 61 | +bool compareMode = true; // default mode is compare mode |
62 | bool mappingMode = false; | 62 | bool mappingMode = false; |
63 | 63 | ||
64 | // random color set | 64 | // random color set |
@@ -68,11 +68,11 @@ std::vector<float> colormap; | @@ -68,11 +68,11 @@ std::vector<float> colormap; | ||
68 | int mods; | 68 | int mods; |
69 | 69 | ||
70 | //OpenGL objects | 70 | //OpenGL objects |
71 | -GLuint cmap_tex = 0; //texture name for the color map | 71 | +GLuint cmap_tex = 0; //texture name for the color map |
72 | 72 | ||
73 | float delta; | 73 | float delta; |
74 | -float sigma = 3; //default sigma | ||
75 | -float radius = 0.7; //equals to radius | 74 | +float sigma = 3; //default sigma |
75 | +float radius = 0.7; //equals to radius | ||
76 | int adjoint_fac = 0; | 76 | int adjoint_fac = 0; |
77 | int light_fac = 0; | 77 | int light_fac = 0; |
78 | int difference_fac = 0; | 78 | int difference_fac = 0; |
@@ -682,8 +682,7 @@ void advertise(){ | @@ -682,8 +682,7 @@ void advertise(){ | ||
682 | std::cout<<" mapping two files in random colors with a threshold of value"<<std::endl<<std::endl; | 682 | std::cout<<" mapping two files in random colors with a threshold of value"<<std::endl<<std::endl; |
683 | } | 683 | } |
684 | 684 | ||
685 | -int main(int argc, char* argv[]) | ||
686 | -{ | 685 | +int main(int argc, char* argv[]) { |
687 | stim::arglist args; //create an instance of arglist | 686 | stim::arglist args; //create an instance of arglist |
688 | 687 | ||
689 | //add arguments | 688 | //add arguments |
@@ -737,9 +736,10 @@ int main(int argc, char* argv[]) | @@ -737,9 +736,10 @@ int main(int argc, char* argv[]) | ||
737 | float threshold = args["mapping"].as_float(); | 736 | float threshold = args["mapping"].as_float(); |
738 | map(sigma, device, threshold); | 737 | map(sigma, device, threshold); |
739 | } | 738 | } |
740 | - else | 739 | + else { |
741 | compare(sigma, device); //run the comparison algorithm | 740 | compare(sigma, device); //run the comparison algorithm |
742 | } | 741 | } |
742 | + } | ||
743 | 743 | ||
744 | //if a GUI is requested, display the network using OpenGL | 744 | //if a GUI is requested, display the network using OpenGL |
745 | if(args["gui"].is_set()){ | 745 | if(args["gui"].is_set()){ |
@@ -755,4 +755,5 @@ int main(int argc, char* argv[]) | @@ -755,4 +755,5 @@ int main(int argc, char* argv[]) | ||
755 | glutMainLoop(); //enter GLUT event processing cycle | 755 | glutMainLoop(); //enter GLUT event processing cycle |
756 | } | 756 | } |
757 | } | 757 | } |
758 | + return 1; | ||
758 | } | 759 | } |