Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

cleaning up

  • Loading branch information...
commit fec2ad54ee388e5064dc642014ccd3487745e67d 1 parent 7664094
rtv authored
View
23 libstage/block.cc
@@ -240,7 +240,7 @@ void Block::SwitchToTestedCells()
// 2. find the set of cells in candidate but not rendered and insert
// them
- // .. and see if that is faster
+ // .. and see if that is faster than the current method
RemoveFromCellArray( rendered_cells );
@@ -395,8 +395,8 @@ void Block::DrawTop()
// draw the top of the block - a polygon at the highest vertical
// extent
glBegin( GL_POLYGON);
- for( unsigned int i=0; i<pt_count; i++ )
- glVertex3f( pts[i].x, pts[i].y, local_z.max );
+ FOR_EACH( it, pts )
+ glVertex3f( it->x, it->y, local_z.max );
glEnd();
}
@@ -404,11 +404,12 @@ void Block::DrawSides()
{
// construct a strip that wraps around the polygon
glBegin(GL_QUAD_STRIP);
- for( unsigned int p=0; p<pt_count; p++)
- {
- glVertex3f( pts[p].x, pts[p].y, local_z.max );
- glVertex3f( pts[p].x, pts[p].y, local_z.min );
- }
+
+ FOR_EACH( it, pts )
+ {
+ glVertex3f( it->x, it->y, local_z.max );
+ glVertex3f( it->x, it->y, local_z.min );
+ }
// close the strip
glVertex3f( pts[0].x, pts[0].y, local_z.max );
glVertex3f( pts[0].x, pts[0].y, local_z.min );
@@ -417,9 +418,9 @@ void Block::DrawSides()
void Block::DrawFootPrint()
{
- glBegin(GL_POLYGON);
- for( unsigned int p=0; p<pt_count; p++ )
- glVertex2f( pts[p].x, pts[p].y );
+ glBegin(GL_POLYGON);
+ FOR_EACH( it, pts )
+ glVertex2f( it->x, it->y );
glEnd();
}
View
1  libstage/canvas.cc
@@ -574,6 +574,7 @@ void Canvas::FixViewport(int W,int H)
void Canvas::AddModel( Model* mod )
{
models_sorted.push_back( mod );
+ redraw();
}
void Canvas::RemoveModel( Model* mod )
View
10 libstage/stage.hh
@@ -899,13 +899,13 @@ namespace Stg
SuperRegion* GetSuperRegionCached( int32_t x, int32_t y );
void ExpireSuperRegion( SuperRegion* sr );
- inline Cell* GetCell( const stg_point_int_t& glob );
+ //inline Cell* GetCell( const stg_point_int_t& glob );
- /** add a Cell pointer to the vector for each cell on the line from
- pt1 to pt2 inclusive */
+ /** add a Cell pointer to the vector for each cell on the line from
+ pt1 to pt2 inclusive */
void ForEachCellInLine( const stg_point_int_t& pt1,
- const stg_point_int_t& pt2,
- CellPtrVec& cells );
+ const stg_point_int_t& pt2,
+ CellPtrVec& cells );
/** convert a distance in meters to a distance in world occupancy
grid pixels */
View
14 libstage/world.cc
@@ -949,12 +949,12 @@ inline SuperRegion* World::GetSuperRegion( const stg_point_int_t& sup )
return sr;
}
-Cell* World::GetCell( const stg_point_int_t& glob )
-{
- return( ((Region*)GetSuperRegionCached( GETSREG(glob.x), GETSREG(glob.y) )
- ->GetRegion( GETREG(glob.x), GETREG(glob.y) ))
- ->GetCell( GETCELL(glob.x), GETCELL(glob.y) )) ;
-}
+// Cell* World::GetCell( const stg_point_int_t& glob )
+// {
+// return( ((Region*)GetSuperRegionCached( GETSREG(glob.x), GETSREG(glob.y) )
+// ->GetRegion( GETREG(glob.x), GETREG(glob.y) ))
+// ->GetCell( GETCELL(glob.x), GETCELL(glob.y) )) ;
+// }
void World::ForEachCellInLine( const stg_point_int_t& start,
@@ -998,7 +998,7 @@ void World::ForEachCellInLine( const stg_point_int_t& start,
n > 0 )
{
// find the cell at this location, then add it to the vector
- cells.push_back( c );
+ cells.push_back( c );
// cleverly skip to the next cell (now it's safe to
// manipulate the cell pointer)
View
1  libstage/worldgui.cc
@@ -593,6 +593,7 @@ void WorldGui::Stop()
// drawn 'cos we cancelled the timeout
canvas->redraw(); // in case something happened that will never be
+ // drawn otherwise
}
void WorldGui::pauseCb( Fl_Widget* w, WorldGui* wg )
Please sign in to comment.
Something went wrong with that request. Please try again.