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 Project Download Mailing lists
|
icestormelement3d.h00001 /* 00002 * Orca-Robotics Project: Components for robotics 00003 * http://orca-robotics.sf.net/ 00004 * Copyright (c) 2004-2009 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_ICESTORM_ELEMENT_3D_H 00012 #define ORCAGUI_ICESTORM_ELEMENT_3D_H 00013 00014 #include <orcaqguielementutil/icestormelement.h> 00015 #include <orcaqgui3d/guielement3d.h> 00016 00017 namespace orcaqgui3d { 00018 00019 template<class PainterType, class DataType, class ProxyType, class ConsumerType, class ConsumerPrxType> 00020 class 00021 IceStormElement3d : public GuiElement3d, 00022 public orcaqguielementutil::IceStormElement<DataType, 00023 ProxyType, 00024 ConsumerType, 00025 ConsumerPrxType> 00026 { 00027 public: 00028 00031 IceStormElement3d( const hydroqguielementutil::GuiElementInfo &guiElementInfo, 00032 const orcaice::Context &context, 00033 PainterType &painter, 00034 const double timeoutMs = 5000.0 ) 00035 : GuiElement3d(guiElementInfo), 00036 orcaqguielementutil::IceStormElement<DataType, 00037 ProxyType, 00038 ConsumerType, 00039 ConsumerPrxType>( 00040 context,guiElementInfo.uniqueId.toStdString(),timeoutMs), 00041 painter_(painter) 00042 {} 00043 00044 // From GuiElement3d 00045 void update(); 00046 00047 protected: 00048 00050 PainterType &painter_; 00051 }; 00052 00053 template<class PainterType, class DataType, class ProxyType, class ConsumerType, class ConsumerPrxType> 00054 void IceStormElement3d<PainterType,DataType,ProxyType,ConsumerType,ConsumerPrxType>::update() 00055 { 00056 if (orcaqguielementutil::IceStormElement<DataType,ProxyType,ConsumerType,ConsumerPrxType>::shouldClearPainter_) 00057 { 00058 painter_.clear(); 00059 orcaqguielementutil::IceStormElement<DataType,ProxyType,ConsumerType,ConsumerPrxType>::shouldClearPainter_ = false; 00060 } 00061 00062 if (orcaqguielementutil::IceStormElement<DataType, 00063 ProxyType, 00064 ConsumerType, 00065 ConsumerPrxType>::updateFromStore() ) 00066 { 00067 // transfer data into painter 00068 painter_.setData( orcaqguielementutil::IceStormElement<DataType,ProxyType,ConsumerType,ConsumerPrxType>::data_ ); 00069 } 00070 } 00071 00072 } 00073 00074 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)