Update of /cvsroot/playerstage/code/stage/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5341/src

Modified Files:
      Tag: opengl
        block.cc gui_gl.c gui_gtk.cc model.cc model_laser.cc 
        model_load.cc raytrace.cc stage_internal.h 
Log Message:
working on 2.5d raytracing

Index: model_laser.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/src/Attic/model_laser.cc,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** model_laser.cc      8 Jul 2007 01:44:09 -0000       1.1.2.1
--- model_laser.cc      9 Jul 2007 00:03:24 -0000       1.1.2.2
***************
*** 146,154 ****
  int laser_raytrace_match( StgModel* mod, StgModel* hitmod )
  {           
!   // Ignore my relatives and thiings that are invisible to lasers
!   //return( (!stg_model_is_related(mod,hitmod)) && 
!   //  (hitmod->laser_return > 0) );
  
!   return(  1 );//hitmod == mod->parent ); 
  }     
  
--- 146,155 ----
  int laser_raytrace_match( StgModel* mod, StgModel* hitmod )
  {           
!   stg_laser_return_t ret;
!   hitmod->GetLaserReturn( &ret );
  
!   // Ignore my relatives and thiings that are invisible to lasers
!   return( //(! stg_model_is_related(mod,hitmod)) && 
!        (mod != hitmod) && (ret > 0) );
  }     
  
***************
*** 200,207 ****
        //                              laser_raytrace_match );
        
!       //double range = cfg->range_max;
!       
!       StgModel* hitmod = itl_next( itl );
        
        if( hitmod )
        {
--- 201,214 ----
        //                              laser_raytrace_match );
        
!       double range = cfg->range_max;
        
+       StgModel* hitmod;      
+       if((hitmod = itl_first_matching( itl, 
+                                      laser_raytrace_match, 
+                                      this ) ))
+       {
+         range = itl->range;
+       }
+           
        if( hitmod )
        {
***************
*** 220,224 ****
        itl_destroy( itl );
        
!       // lower bound on range
        
        // if the object is bright, it has a non-zero reflectance
--- 227,231 ----
        itl_destroy( itl );
        
!       // todo - lower bound on range
        
        // if the object is bright, it has a non-zero reflectance

Index: model.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/src/Attic/model.cc,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -d -r1.1.2.2 -r1.1.2.3
*** model.cc    8 Jul 2007 05:24:04 -0000       1.1.2.2
--- model.cc    9 Jul 2007 00:03:24 -0000       1.1.2.3
***************
*** 148,157 ****
  void StgModel::AddBlock( stg_point_t* pts, 
                         size_t pt_count,
!                        stg_meters_t height,
!                        stg_meters_t z_offset )
  {
    this->blocks = 
      g_list_prepend( this->blocks, 
!                   stg_block_create( this, pts, pt_count, height, z_offset )); 
 
    
    // force recreation of display lists before drawing
--- 148,161 ----
  void StgModel::AddBlock( stg_point_t* pts, 
                         size_t pt_count,
!                        stg_meters_t zmin,
!                        stg_meters_t zmax,
!                        stg_color_t col,
!                        bool inherit_color )
  {
    this->blocks = 
      g_list_prepend( this->blocks, 
!                   stg_block_create( this, pts, pt_count, 
!                                     zmin, zmax, 
!                                     col, inherit_color ));  
    
    // force recreation of display lists before drawing
***************
*** 174,178 ****
  
    // todo - fix this
!   this->AddBlock( pts, 4, this->geom.size.z, 0 );           
  }
  
--- 178,182 ----
  
    // todo - fix this
!   this->AddBlock( pts, 4, 0, 1, 0, true );          
  }
  
***************
*** 327,331 ****
  
    // now we can add the basic square shape
!   this->AddBlockRect( 0,0,1,1 );
  
    this->data = this->cfg = this->cmd = NULL;
--- 331,335 ----
  
    // now we can add the basic square shape
!   this->AddBlockRect( -0.5,-0.5,1,1 );
  
    this->data = this->cfg = this->cmd = NULL;

Index: stage_internal.h
===================================================================
RCS file: /cvsroot/playerstage/code/stage/src/stage_internal.h,v
retrieving revision 1.58.2.15
retrieving revision 1.58.2.16
diff -C2 -d -r1.58.2.15 -r1.58.2.16
*** stage_internal.h    8 Jul 2007 01:44:09 -0000       1.58.2.15
--- stage_internal.h    9 Jul 2007 00:03:24 -0000       1.58.2.16
***************
*** 66,71 ****
      stg_point_t* pts; //< points defining a polygon
      size_t pt_count; //< the number of points
!     stg_meters_t height; //<< vertical size of the block
!     stg_meters_t z_offset; //< offset along the z axis
      int display_list; //< id of the OpenGL displaylist to draw this block
    } stg_block_t;
--- 66,73 ----
      stg_point_t* pts; //< points defining a polygon
      size_t pt_count; //< the number of points
!     stg_meters_t zmin; 
!     stg_meters_t zmax; 
!     stg_color_t color;
!     bool inherit_color;
      int display_list; //< id of the OpenGL displaylist to draw this block
    } stg_block_t;
***************
*** 79,83 ****
                                 size_t pt_count,
                                 stg_meters_t height,
!                                stg_meters_t z_offset );
      
    /** destroy a block, freeing all memory */
--- 81,87 ----
                                 size_t pt_count,
                                 stg_meters_t height,
!                                stg_meters_t z_offset,
!                                stg_color_t color,
!                                bool inherit_color );
      
    /** destroy a block, freeing all memory */
***************
*** 455,461 ****
      double range; // range to hit location
      StgModel* mod; // hit model
    } stg_hit_t;
  
!   typedef struct
    {
      double x, y, a;
--- 459,466 ----
      double range; // range to hit location
      StgModel* mod; // hit model
+     //stg_block_t* block; // hit block
    } stg_hit_t;
  
!  typedef struct
    {
      double x, y, a;
***************
*** 464,492 ****
      double max_range;
      double* incr;
-     double x1,y1,x2,y2; // end points of the ray from x1,y1 to x2,y2
  
      GSList* models;
      int index;
      stg_matrix_t* matrix;    
-   
-     GList* hits;
-     GList* current;
- 
    } itl_t;
!   
    typedef enum { PointToPoint=0, PointToBearingRange } itl_mode_t;
!   
    typedef int(*stg_itl_test_func_t)(StgModel* finder, StgModel* found );
!   
    itl_t* itl_create( double x, double y, double a, double b, 
!                    stg_matrix_t* matrix, itl_mode_t pmode );
!   
    void itl_destroy( itl_t* itl );
!   void itl_raytrace( itl_t* itl );
!   StgModel* itl_next( itl_t* itl );
  
!   StgModel* itl_first_matching( itl_t* itl, 
!                                  stg_itl_test_func_t func, 
!                                  StgModel* finder );
  
    /** @} */
--- 469,491 ----
      double max_range;
      double* incr;
  
      GSList* models;
      int index;
      stg_matrix_t* matrix;    
    } itl_t;
! 
    typedef enum { PointToPoint=0, PointToBearingRange } itl_mode_t;
! 
    typedef int(*stg_itl_test_func_t)(StgModel* finder, StgModel* found );
! 
    itl_t* itl_create( double x, double y, double a, double b, 
!                  stg_matrix_t* matrix, itl_mode_t pmode );
! 
    void itl_destroy( itl_t* itl );
! void itl_raytrace( itl_t* itl );
  
! StgModel* itl_first_matching( itl_t* itl, 
!                             stg_itl_test_func_t func, 
!                             StgModel* finder );
  
    /** @} */

Index: raytrace.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/src/Attic/raytrace.cc,v
retrieving revision 1.12.2.1
retrieving revision 1.12.2.2
diff -C2 -d -r1.12.2.1 -r1.12.2.2
*** raytrace.cc 8 Jul 2007 01:44:09 -0000       1.12.2.1
--- raytrace.cc 9 Jul 2007 00:03:24 -0000       1.12.2.2
***************
*** 61,66 ****
    
    itl->matrix = matrix;
-   itl->x1 = x;
-   itl->y1 = y;
    itl->x = x;
    itl->y = y;
--- 61,64 ----
***************
*** 68,72 ****
    itl->index = 0;
    itl->range = 0;  
-   itl->incr = NULL;
  
    stg_bbox3d_t bbox;
--- 66,69 ----
***************
*** 80,91 ****
        itl->a = NORMALIZE(bearing);
        itl->max_range = range; 
-       itl->x2 = x + range * cos( bearing ); 
-       itl->y2 = y + range * sin( bearing );             
        }
        break;
      case PointToPoint:
        {
-       itl->x2 = a;
-       itl->y2 = b;
        itl->a = atan2( b-y, a-x );
        itl->max_range = hypot( a-x, b-y );       
--- 77,84 ----
***************
*** 95,114 ****
        puts( "Stage Warning: unknown LineIterator mode" );
      }
-   
-   bbox.x.min = MIN( itl->x1, itl->x2 );
-   bbox.x.max = MAX( itl->x1, itl->x2 );
-   bbox.y.min = MIN( itl->y1, itl->y2 );
-   bbox.y.max = MAX( itl->y1, itl->y2 );
-   bbox.z.min = 0.0;
-   bbox.z.max = 1.0;
-   
- 
    //printf( "a = %.2f remaining_range = %.2f\n", itl->a,
    //remaining_range ); fflush( stdout );
    
    // find all the models that overlap with this bbox
- 
- 
-   
    itl->cosa = cos( itl->a );
    itl->sina = sin( itl->a );
--- 88,95 ----
***************
*** 134,148 ****
    if( itl )
      {
!       if( itl->hits )
!       {
!         GList* it;
!         for( it=itl->hits; it; it=it->next )
!           g_free( it->data );
              
!         g_list_free( itl->hits );
!       }
  
-       if( itl->incr ) 
-       g_free( itl->incr );
        g_free( itl );
      }
--- 115,131 ----
    if( itl )
      {
! //       if( itl->hits )
! //    {
! //      GList* it;
! //      for( it=itl->hits; it; it=it->next )
! //        if( it->data )
! //            g_free( it->data );
              
! //      g_list_free( itl->hits );
! //    }
! 
! //      if( itl->incr ) 
!       //g_free( itl->incr );
  
        g_free( itl );
      }
***************
*** 175,189 ****
  }
  
  // returns the first model in the array that matches, else NULL.
  static StgModel* gslist_first_matching( GSList* list, 
!                                   stg_itl_test_func_t func, 
!                                   StgModel* finder )
  {
    for( ; list ; list=list->next )
      {
!       // height check
!       if( stg_model_height_check( finder, (StgModel*)(list->data) ) &&
!         (*func)( finder, (StgModel*)(list->data) ) )
!       return (StgModel*)(list->data);
      }
    
--- 158,188 ----
  }
  
+ 
  // returns the first model in the array that matches, else NULL.
  static StgModel* gslist_first_matching( GSList* list, 
!                                       stg_itl_test_func_t func, 
!                                       StgModel* finder )
  {
    for( ; list ; list=list->next )
      {
!       stg_block_t* block = (stg_block_t*)list->data;
! 
!       // test the block's height. It must overlap the origin of the
!       // finding model
! 
!       stg_pose_t gpose;
!       finder->GetGlobalPose( &gpose );
! 
!       stg_geom_t geom;
!       finder->GetGeom( &geom );
! 
!       //if( (block->zmin < gpose.z - geom.size.z/2.0) || 
!       //  (block->zmax > gpose.z + geom.size.z/2.0) )
!       //return NULL; // no overlap
! 
!       StgModel* candidate = block->mod;
! 
!       if( (*func)( finder, candidate ) )
!       return candidate;
      }
    
***************
*** 191,194 ****
--- 190,194 ----
  }
  
+ 
  // in the tree that contains cell, find the smallest node at x,y. cell
  // does not have to be the root. non-recursive for speed.
***************
*** 231,292 ****
  }
  
- StgModel* itl_next2( itl_t* itl )
- {
-   if( itl->current )
-     {
-       stg_hit_t* hit = (stg_hit_t*)itl->current->data;
-       StgModel* mod = hit->mod;
-       itl->range = hit->range;
-       itl->x = hit->x;
-       itl->y = hit->y;
-       itl->current = itl->current->next;
-       return mod;
-     }
-   else
-     return NULL;
- }
- 
- StgModel* itl_next( itl_t* itl )
- {
-   if( itl->current )
-     {
-       stg_hit_t* hit = (stg_hit_t*)itl->current->data;      
-       itl->range = hit->range;
-       itl->x = hit->x;
-       itl->y = hit->y;      
-       
-       // shift to the next hit
-       itl->current=itl->current->next;      
- 
-       return hit->mod;
-     }  
-   
-   return NULL; // we ran out of models
- }
- 
  StgModel* itl_first_matching( itl_t* itl, 
!                                stg_itl_test_func_t func, 
!                                StgModel* finder )
  {
-   for( ; itl->current; itl->current=itl->current->next )
-     {
-       stg_hit_t* hit = (stg_hit_t*)itl->current->data;
-       
-       printf( "testing model %s against matching func\n", hit->mod->Token() );
- 
-       if( (*func)( hit->mod, finder ) )
-       {
-         itl->range = hit->range;
-         itl->x = hit->x;
-         itl->y = hit->y;
- 
-         return hit->mod;
-       }
-     }
- 
-   return NULL; // didn't find a model
- 
-   //!
- 
    itl->index = 0;
    itl->models = NULL;  
--- 231,238 ----
  }
  
  StgModel* itl_first_matching( itl_t* itl, 
!                             stg_itl_test_func_t func, 
!                             StgModel* finder )
  {
    itl->index = 0;
    itl->models = NULL;  
***************
*** 306,313 ****
        }
        
! /*       if( fig_debug_rays ) // draw the cell rectangle */
! /*    stg_rtk_fig_rectangle( fig_debug_rays, */
! /*                           cell->x, cell->y, 0,  */
! /*                           cell->size, cell->size, 0 );             */
        if( cell->data ) 
        { 
--- 252,260 ----
        }
        
!       //if( fig_debug_rays ) // draw the cell rectangle
!         //stg_rtk_fig_rectangle( fig_debug_rays,
!       //             cell->x, cell->y, 0, 
!       //                     cell->size, cell->size, 0 );            
! 
        if( cell->data ) 
        { 
***************
*** 376,386 ****
        }
        
! /*       if( fig_debug_rays ) // draw the cell rectangle */
! /*    { */
! /*      stg_rtk_fig_color_rgb32( fig_debug_rays, 0xFFBBBB ); */
! /*      stg_rtk_fig_arrow_ex( fig_debug_rays,  */
! /*                            itl->x, itl->y, xleave, yleave, 0.01 ); */
! /*      stg_rtk_fig_color_rgb32( fig_debug_rays, 0xFF0000 ); */
! /*    } */
  
        // jump to the leave point
--- 323,333 ----
        }
        
!       //     if( fig_debug_rays ) // draw the cell rectangle
!       //{
!       //  stg_rtk_fig_color_rgb32( fig_debug_rays, 0xFFBBBB );
!       //  stg_rtk_fig_arrow_ex( fig_debug_rays, 
!       //                      itl->x, itl->y, xleave, yleave, 0.01 );
!       //  stg_rtk_fig_color_rgb32( fig_debug_rays, 0xFF0000 );
!       //}
  
        // jump to the leave point
***************
*** 393,397 ****
    return NULL; // we didn't find anything
  }
- 
- 
- 
--- 340,341 ----

Index: model_load.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/src/Attic/model_load.cc,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -d -r1.1.2.2 -r1.1.2.3
*** model_load.cc       8 Jul 2007 05:24:04 -0000       1.1.2.2
--- model_load.cc       9 Jul 2007 00:03:24 -0000       1.1.2.3
***************
*** 240,266 ****
              }
            
! /*        // block height */
! /*        double height = this->geom.size.z; */
! /*        snprintf(key, sizeof(key), "block[%d].height", l); */
! /*        if( wf->PropertyExists( this->id, key ) ) */
! /*          height = wf_read_length(this->id, key, height); */
!           
! /*        // block color */
! /*        stg_color_t color = this->color; */
! /*        snprintf(key, sizeof(key), "block[%d].color", l); */
! /*        if( wf->PropertyExists( this->id, key ) ) */
! /*          color = stg_lookup_color( wf_read_string(this->id, key, NULL ));  
*/
!           
!           snprintf(key, sizeof(key), "block[%d].height", l);
            
!           stg_meters_t height = 
!             wf->ReadLength(this->id, key,  this->geom.size.z );
            
!           snprintf(key, sizeof(key), "block[%d].z_offset", l);
            
!           stg_meters_t z_offset = 
!             wf->ReadLength(this->id, key, 0 );
!             
!           this->AddBlock( pts, pointcount, height, z_offset );        
            
            stg_points_destroy( pts );
--- 240,266 ----
              }
            
!           // block Z axis
!           snprintf(key, sizeof(key), "block[%d].z", l);
            
!           stg_meters_t zmin = 
!             wf->ReadTupleLength(this->id, key, 0, 0.0 );
! 
!           stg_meters_t zmax = 
!             wf->ReadTupleLength(this->id, key, 1, 1.0 );
            
!           // block color
!           stg_color_t blockcol = this->color;
!           bool inherit_color = true;
! 
!           snprintf(key, sizeof(key), "block[%d].color", l);
! 
!           const char* colorstr = wf->ReadString( this->id, key, NULL );
!           if( colorstr )
!             {
!               blockcol = stg_lookup_color( colorstr );  
!               inherit_color = false;
!             }
            
!           this->AddBlock( pts, pointcount, zmin, zmax, blockcol, 
inherit_color );     
            
            stg_points_destroy( pts );

Index: gui_gl.c
===================================================================
RCS file: /cvsroot/playerstage/code/stage/src/Attic/gui_gl.c,v
retrieving revision 1.1.2.25
retrieving revision 1.1.2.26
diff -C2 -d -r1.1.2.25 -r1.1.2.26
*** gui_gl.c    8 Jul 2007 05:24:04 -0000       1.1.2.25
--- gui_gl.c    9 Jul 2007 00:03:24 -0000       1.1.2.26
***************
*** 503,513 ****
    //glTranslatef( 0,0,0.1 );
  
-   //push_color_rgb( 1, 0.5, 0.5 );
-   //glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
-   //glRectf( -dx, -dy, dx, dy );
- 
-   push_color_rgb( 1, 0, 0 );
-   glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
-   glLineWidth( 2 );
    glRectf( -dx, -dy, dx, dy );
  
--- 503,506 ----
***************
*** 928,939 ****
    //glCallList( dl_debug );
  
! /*   glTranslatef( 0,0,1 ); */
! /*   glPolygonMode( GL_FRONT_AND_BACK, GL_LINE ); */
! /*   push_color_rgb( 0,1,0 ); */
! /*   stg_cell_render_tree( world->matrix->root ); */
! /*   glTranslatef( 0,0,-1 ); */
! /*   pop_color(); */
  
    g_list_foreach( world->win->selected_models, (GFunc)gl_model_selected, NULL 
);
  
    // draw the models
--- 921,939 ----
    //glCallList( dl_debug );
  
!   if( win->show_matrix )
!     {
!       glTranslatef( 0,0,1 );
!       glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
!       push_color_rgb( 0,1,0 );
!       stg_cell_render_tree( world->matrix->root );
!       glTranslatef( 0,0,-1 );
!       pop_color();
!     }
  
+   push_color_rgb( 1, 0, 0 );
+   glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+   glLineWidth( 2 );
    g_list_foreach( world->win->selected_models, (GFunc)gl_model_selected, NULL 
);
+   glLineWidth( 1 );
  
    // draw the models

Index: block.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/src/Attic/block.cc,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -d -r1.1.2.2 -r1.1.2.3
*** block.cc    8 Jul 2007 02:08:53 -0000       1.1.2.2
--- block.cc    9 Jul 2007 00:03:24 -0000       1.1.2.3
***************
*** 10,15 ****
                               stg_point_t* pts, 
                               size_t pt_count,
!                              stg_meters_t height,
!                              stg_meters_t z_offset )
  {
    //printf( "Creating block with %d points\n", (int)pt_count );
--- 10,17 ----
                               stg_point_t* pts, 
                               size_t pt_count,
!                              stg_meters_t zmin,
!                              stg_meters_t zmax,
!                              stg_color_t color,
!                              bool inherit_color )
  {
    //printf( "Creating block with %d points\n", (int)pt_count );
***************
*** 20,25 ****
    block->pt_count = pt_count;
    block->pts = (stg_point_t*)g_memdup( pts, pt_count * sizeof(stg_point_t));
!   block->z_offset = z_offset;
!   block->height = height;
  
    // generate an OpenGL displaylist for this block
--- 22,29 ----
    block->pt_count = pt_count;
    block->pts = (stg_point_t*)g_memdup( pts, pt_count * sizeof(stg_point_t));
!   block->zmin = zmin;
!   block->zmax = zmax;
!   block->color = color;
!   block->inherit_color = inherit_color;
  
    // generate an OpenGL displaylist for this block
***************
*** 64,68 ****
    for( unsigned int p=0; p<b->pt_count; p++)
      {
!     glVertex3f( b->pts[p].x, b->pts[p].y, b->z_offset + b->height );
      }
    glEnd();
--- 68,72 ----
    for( unsigned int p=0; p<b->pt_count; p++)
      {
!     glVertex3f( b->pts[p].x, b->pts[p].y, b->zmax );
      }
    glEnd();
***************
*** 78,87 ****
    for( unsigned int p=0; p<b->pt_count; p++)
      {
!       glVertex3f( b->pts[p].x, b->pts[p].y, b->z_offset + b->height );
!       glVertex3f( b->pts[p].x, b->pts[p].y, b->z_offset );
      }
    // close the strip
!   glVertex3f( b->pts[0].x, b->pts[0].y, b->z_offset + b->height );
!   glVertex3f( b->pts[0].x, b->pts[0].y, b->z_offset );
    glEnd();
  }
--- 82,91 ----
    for( unsigned int p=0; p<b->pt_count; p++)
      {
!       glVertex3f( b->pts[p].x, b->pts[p].y, b->zmax );
!       glVertex3f( b->pts[p].x, b->pts[p].y, b->zmin );
      }
    // close the strip
!   glVertex3f( b->pts[0].x, b->pts[0].y, b->zmax );
!   glVertex3f( b->pts[0].x, b->pts[0].y, b->zmin );
    glEnd();
  }
***************
*** 89,98 ****
  void stg_block_update( stg_block_t* b )
  { 
    glNewList( b->display_list, GL_COMPILE );
  
    stg_color_t color;
!   b->mod->GetColor( &color );
! 
!   // draw filled color polygons
    double gcol[4];       
    stg_color_to_glcolor4dv( color, gcol );
--- 93,106 ----
  void stg_block_update( stg_block_t* b )
  { 
+   // draw filled color polygons
+ 
    glNewList( b->display_list, GL_COMPILE );
  
    stg_color_t color;
!   if( b->inherit_color )
!     b->mod->GetColor( &color );
!   else
!     color = b->color;
!     
    double gcol[4];       
    stg_color_to_glcolor4dv( color, gcol );
***************
*** 109,113 ****
    glDisable(GL_POLYGON_OFFSET_FILL);
    
-   pop_color();
  
    // draw the block outline in a darker version of the same color
--- 117,120 ----
***************
*** 126,129 ****
--- 133,137 ----
  
    pop_color();
+   pop_color();
  
    glEndList();
***************
*** 162,167 ****
  
        
!       if( (block->height + block->z_offset) > maxz )
!       maxz = (block->height + block->z_offset);
      }
  
--- 170,175 ----
  
        
!       if( block->zmax > maxz )
!       maxz = block->zmax;
      }
  
***************
*** 190,195 ****
        }
  
!       block->height *= scalez;
!       block->z_offset *= scalez;
  
        // recalculate the GL drawlist
--- 198,204 ----
        }
  
!       // todo - scale min properly
!       block->zmax *= scalez;
!       block->zmin *= scalez;
  
        // recalculate the GL drawlist

Index: gui_gtk.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/src/Attic/gui_gtk.cc,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -d -r1.1.2.2 -r1.1.2.3
*** gui_gtk.cc  8 Jul 2007 05:24:04 -0000       1.1.2.2
--- gui_gtk.cc  9 Jul 2007 00:03:24 -0000       1.1.2.3
***************
*** 167,171 ****
  /* void gui_action_raytrace( GtkToggleAction* action, stg_world_t* world );  
*/
  /* void gui_action_geom( GtkToggleAction* action, stg_world_t* world );  */
! /* void gui_action_matrixtree( GtkToggleAction* action, stg_world_t* world ); 
 */
  /* void gui_action_matrixocc( GtkToggleAction* action, stg_world_t* world );  
*/
  /* void gui_action_matrixdelta( GtkToggleAction* action, stg_world_t* world 
); */
--- 167,171 ----
  /* void gui_action_raytrace( GtkToggleAction* action, stg_world_t* world );  
*/
  /* void gui_action_geom( GtkToggleAction* action, stg_world_t* world );  */
! void gui_action_matrixtree( GtkToggleAction* action, stg_world_t* world );  
  /* void gui_action_matrixocc( GtkToggleAction* action, stg_world_t* world );  
*/
  /* void gui_action_matrixdelta( GtkToggleAction* action, stg_world_t* world 
); */
***************
*** 219,223 ****
  /*   { "DebugRays", NULL, "_Raytrace", "<alt>R", "Draw sensor rays", 
G_CALLBACK(gui_action_raytrace), 0 }, */
  /*   { "DebugGeom", NULL, "_Geometry", "<alt>G", "Draw model geometry", 
G_CALLBACK(gui_action_geom), 0 }, */
! /*   { "DebugMatrixTree", NULL, "Matrix _Tree", "<alt>T", "Show occupancy 
quadtree", G_CALLBACK(gui_action_matrixtree), 0 }, */
  /*   { "DebugMatrixOccupancy", NULL, "Matrix _Occupancy", "<alt>M", "Show 
occupancy grid", G_CALLBACK(gui_action_matrixocc), 0 }, */
  /*   { "DebugMatrixDelta", NULL, "Matrix _Delta", "<alt>D", "Show changes to 
quadtree", G_CALLBACK(gui_action_matrixdelta), 0 }, */
--- 219,223 ----
  /*   { "DebugRays", NULL, "_Raytrace", "<alt>R", "Draw sensor rays", 
G_CALLBACK(gui_action_raytrace), 0 }, */
  /*   { "DebugGeom", NULL, "_Geometry", "<alt>G", "Draw model geometry", 
G_CALLBACK(gui_action_geom), 0 }, */
!    { "DebugMatrixTree", NULL, "Matrix _Tree", "<alt>T", "Show occupancy 
quadtree", G_CALLBACK(gui_action_matrixtree), 0 }, 
  /*   { "DebugMatrixOccupancy", NULL, "Matrix _Occupancy", "<alt>M", "Show 
occupancy grid", G_CALLBACK(gui_action_matrixocc), 0 }, */
  /*   { "DebugMatrixDelta", NULL, "Matrix _Delta", "<alt>D", "Show changes to 
quadtree", G_CALLBACK(gui_action_matrixdelta), 0 }, */
***************
*** 277,280 ****
--- 277,281 ----
  "      <menuitem action='Trails'/>"
  "      <menuitem action='Thumbnail'/>"
+ "      <menuitem action='DebugMatrixTree'/>" 
  "      <separator/>"
  "      <menuitem action='Derotate'/>"
***************
*** 283,287 ****
  /* "          <menuitem action='DebugRays'/>" */
  /* "          <menuitem action='DebugGeom'/>" */
- /* "          <menuitem action='DebugMatrixTree'/>" */
  /* "          <menuitem action='DebugMatrixOccupancy'/>" */
  /* "          <menuitem action='DebugMatrixDelta'/>" */
--- 284,287 ----
***************
*** 430,433 ****
--- 430,440 ----
  }
  
+ void gui_action_matrixtree( GtkToggleAction* action, stg_world_t* world )
+ {
+   PRINT_DEBUG( "MatrixTree menu item" );
+   world->win->show_matrix = gtk_toggle_action_get_active( action );
+   world->win->dirty = true;
+ }
+ 
  
  void gui_add_tree_item( StgModel* mod )


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to