INTRODUCTION
Overview
Download and Install
Quick Start
Documentation
Publications

NONFRAMEWORK CODE
Driver Interfaces
Drivers
Libraries
Utilities

FRAMEWORK CODE
Interfaces
Components
Libraries
Utilities

Full Software Listings

DEVELOPER
Tutorials
Examples
Dev Guide
Dashboard

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         

libs/orcapublish/qgraphics2dpublisher.h

00001 #ifndef ORCAPUBLISH_QGRAPHICS2DPUBLISHER_H
00002 #define ORCAPUBLISH_QGRAPHICS2DPUBLISHER_H
00003 
00004 #include <hydropublish/qgraphics2dpublisher.h>
00005 #include <orcaifaceimpl/qgraphics2d.h>
00006 
00007 namespace orcapublish {
00008 
00009 namespace detail {
00010 
00011     inline void convert( const QPicture &pic,
00012                          orca::QGraphics2dData &orcaPic )
00013     {
00014         orcaPic.z = 8;
00015         orcaPic.isInGlobalCS = true;
00016         
00017         orcaPic.qpicture.resize( pic.size() );
00018         memcpy( &(orcaPic.qpicture[0]), pic.data(), pic.size() );
00019     }
00020 }
00021 
00025 class QGraphics2dPublisher : public hydropublish::QGraphics2dPublisher
00026 {
00027 public: 
00028 
00029     QGraphics2dPublisher( const orcaice::Context &context, const std::string &name )
00030         : impl_(new orcaifaceimpl::QGraphics2dImpl(context,name))
00031         {
00032         }
00033 
00034     inline void init()
00035         { 
00036             impl_->initInterface(); 
00037             QPicture emptyPic;
00038             localSetAndSend( emptyPic );
00039         }
00040     inline void localSetAndSend( const QPicture &picture )
00041         { 
00042             detail::convert( picture, orcaQGraphics2dData_ );
00043             impl_->localSetAndSend( orcaQGraphics2dData_ );
00044         }
00045 
00046 private: 
00047 
00048     orcaifaceimpl::QGraphics2dImplPtr impl_;
00049     orca::QGraphics2dData orcaQGraphics2dData_;
00050 };
00051 
00052 class QGraphics2dPublisherFactory : public hydropublish::QGraphics2dPublisherFactory
00053 {
00054 public:
00055     QGraphics2dPublisherFactory( const orcaice::Context &context )
00056         : context_(context)
00057         {}
00058 
00059     hydropublish::QGraphics2dPublisherPtr createPublisher( const std::string &name )
00060         { return hydropublish::QGraphics2dPublisherPtr(new QGraphics2dPublisher( context_, name )); }
00061 
00062 private:
00063 
00064     orcaice::Context context_;
00065 };
00066 
00067 }
00068 
00069 #endif
 

Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)


Generated for Orca Robotics by  doxygen 1.4.5