Commit 05a8962f authored by Luis Peñaranda's avatar Luis Peñaranda

read max fov from rc file

parent 25566466
...@@ -38,8 +38,6 @@ OpenGLCanvas::OpenGLCanvas(QWidget *parent) : ...@@ -38,8 +38,6 @@ OpenGLCanvas::OpenGLCanvas(QWidget *parent) :
time_timer.setInterval(0); time_timer.setInterval(0);
connect(&time_timer, SIGNAL(timeout()), this, SLOT(slotTimer())); connect(&time_timer, SIGNAL(timeout()), this, SLOT(slotTimer()));
time_start = time_time.time(); time_start = time_time.time();
fprintf(stderr,"scale=%f\nfov_max=%f\n",scale,fov_max);
} }
void OpenGLCanvas::slotTimer(void) { void OpenGLCanvas::slotTimer(void) {
...@@ -151,6 +149,7 @@ void OpenGLCanvas::read_config_file(){ ...@@ -151,6 +149,7 @@ void OpenGLCanvas::read_config_file(){
shader_dir[0]='\0'; shader_dir[0]='\0';
input_image_file=(char*)malloc(512*sizeof(char)); input_image_file=(char*)malloc(512*sizeof(char));
input_image_file[0]='\0'; input_image_file[0]='\0';
char *max_fov_str=(char*)malloc(64*sizeof(char));
struct stat testbuf; struct stat testbuf;
if(stat(filepath,&testbuf)){ if(stat(filepath,&testbuf)){
fprintf(stderr,"~/.panorc does not exist\n"); fprintf(stderr,"~/.panorc does not exist\n");
...@@ -180,6 +179,13 @@ void OpenGLCanvas::read_config_file(){ ...@@ -180,6 +179,13 @@ void OpenGLCanvas::read_config_file(){
input_image_file[strlen(line)-12]='\0'; input_image_file[strlen(line)-12]='\0';
fprintf(stderr,"input_image_file=%s\n",input_image_file); fprintf(stderr,"input_image_file=%s\n",input_image_file);
} }
// check for 'max_fov' option
if(!strncmp(line,"max_fov=",8)){
strcpy(max_fov_str,line+8);
max_fov_str[strlen(line)-9]='\0';
fov_max=atof(max_fov_str);
fprintf(stderr,"max_fov=%f\n",fov_max);
}
} }
fclose(rcfile); fclose(rcfile);
} }
......
...@@ -95,7 +95,6 @@ private: ...@@ -95,7 +95,6 @@ private:
//float windowWidth; //float windowWidth;
//float windowHeight; //float windowHeight;
// options set in the rc file
char* shader_dir; char* shader_dir;
char* input_image_file; char* input_image_file;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment