|
orca-robotics INTRODUCTION Overview Download and Install Quick Start Documentation Publications REPOSITORY Interfaces Components Libraries Utilities Software Map DEVELOPER Tutorials Examples Dev Guide Dashboard Wiki login/pass: orca/orca PEOPLE Contributors Users Project Download Mailing lists
|
orcaqgui3dfactory/ogmappainter.h00001 /* 00002 * Orca-Robotics Project: Components for robotics 00003 * http://orca-robotics.sf.net/ 00004 * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp 00005 * 00006 * This copy of Orca is licensed to you under the terms described in 00007 * the LICENSE file included in this distribution. 00008 * 00009 */ 00010 00011 #ifndef ORCAGUI_OGMAP_PAINTER_H 00012 #define ORCAGUI_OGMAP_PAINTER_H 00013 00014 #include <orca/ogmap.h> 00015 #include <hydroogmap/hydroogmap.h> 00016 #include <orcaice/context.h> 00017 #include <hydroqguielementutil/definitions2d.h> 00018 #include <orcaqgui2dfactory/pixmappainter.h> 00019 #include <osg/Group> 00020 #include <osg/Geode> 00021 #include <osg/PositionAttitudeTransform> 00022 00023 namespace orcaqgui3d 00024 { 00025 00026 class OgMapPainter 00027 { 00028 00029 public: 00030 OgMapPainter(); 00031 00032 void setData( const orca::OgMapData& data ); 00033 00034 void clear() {}; 00035 void toggleDisplay() { isDisplay_=!isDisplay_; setDisplayElements(); } 00036 void toggleWalls() { isDisplayWalls_=!isDisplayWalls_; setDisplayElements(); } 00037 void toggleGroundPlane() { isDisplayGroundPlane_=!isDisplayGroundPlane_; setDisplayElements(); } 00038 00039 osg::Node *osgNode() const { return root_.get(); } 00040 00041 private: 00042 00043 void setDisplayElements(); 00044 00045 osg::ref_ptr<osg::Geode> drawAsWalls( const hydroogmap::OgMap &ogMap ); 00046 osg::ref_ptr<osg::Geode> drawAsGroundPlane( const hydroogmap::OgMap &ogMap ); 00047 00048 osg::ref_ptr<osg::Group> root_; 00049 osg::ref_ptr<osg::PositionAttitudeTransform> offsetNode_; 00050 osg::ref_ptr<osg::Geode> groundPlaneGeode_; 00051 osg::ref_ptr<osg::Geode> wallsGeode_; 00052 00053 bool isDisplay_; 00054 bool isDisplayWalls_; 00055 bool isDisplayGroundPlane_; 00056 }; 00057 00058 } // namespace 00059 00060 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)
1.4.5