~gimaker/peekabot/og3d-caching

« back to all changes in this revision

Viewing changes to src/RendererRelayImpl.cc

  • Committer: Staffan Gimåker
  • Date: 2010-06-08 14:51:28 UTC
  • Revision ID: staffan@gimaker.se-20100608145128-df8d8it7ijxw03ib
Added experimental support for 3D occupancy grids.

Occupied cells (occupancy value larger than 0.5) are drawn as opaque cubes;
free and unexplored is not drawn at all.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
#include "PointCloud.hh"
40
40
#include "LineCloud.hh"
41
41
#include "OccupancyGrid2D.hh"
 
42
#include "OccupancyGrid3D.hh"
42
43
#include "Label.hh"
43
44
#include "TriMesh.hh"
44
45
#include "Polyline.hh"
56
57
#include "renderer/api/LabelProxy.hh"
57
58
#include "renderer/api/PolygonProxy.hh"
58
59
#include "renderer/api/OccupancyGrid2DProxy.hh"
 
60
#include "renderer/api/OccupancyGrid3DProxy.hh"
59
61
#include "renderer/api/DummyProxy.hh"
60
62
#include "renderer/api/PolylineProxy.hh"
61
63
 
366
368
            boost::bind(&OccupancyGrid2DProxy::set_cells, proxy, _2)));
367
369
}
368
370
 
 
371
void RendererRelay::Impl::visit(OccupancyGrid3D *object)
 
372
{
 
373
    OccupancyGrid3DProxy *proxy = new OccupancyGrid3DProxy(
 
374
        *m_renderer, object->get_cell_size());
 
375
    _proxy = proxy;
 
376
 
 
377
    //proxy->set_cells(object->get_cells());
 
378
 
 
379
    record_connection(
 
380
        object,
 
381
        object->m_on_cells_set.connect(
 
382
            boost::bind(&OccupancyGrid3DProxy::set_cells, proxy, _2)));
 
383
}
 
384
 
369
385
void RendererRelay::Impl::visit(Label *object)
370
386
{
371
387
    LabelProxy *proxy = new LabelProxy(*m_renderer);