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
|
provided.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 ORCAQUML_PROVIDED_H 00012 #define ORCAQUML_PROVIDED_H 00013 00014 #include <orcadef/componentdefinition.h> 00015 #include <orcaquml/model.h> 00016 #include <orcaquml/interface.h> 00017 00018 namespace orcaquml 00019 { 00020 00021 class Provided: public Interface 00022 { 00023 public: 00024 Provided( Component* parent, 00025 QGraphicsScene* scene, 00026 orcadef::ProvidedDef &def, 00027 orcadef::ProvidedCfg &cfg, 00028 InterfaceGeom &geom ); 00029 00030 QString interface() { return QString::fromStdString( def_.type ); }; 00031 QString tag() { return QString::fromStdString( cfg_.tag ); }; 00032 QString name() { return QString::fromStdString( cfg_.name ); }; 00033 00034 bool isClient() const { return false; }; 00035 int maxConnections() const { return maxConnections_; }; 00036 void checkValid() { setValid( true ); }; 00037 00038 // void writeConfig( QDomElement & ); 00039 // void getConfig( QDomElement & ); 00040 void setLabel(); 00041 00042 virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *item, QWidget *widget); 00043 00044 virtual int rtti () const { return RTTI_PROVIDED_INTERFACE; }; 00045 00046 // Returns a human-readable description (useful for debugging) 00047 // virtual const std::string description() const; 00048 00049 const orcadef::ProvidedCfg &cfg() const { return cfg_; } 00050 00051 private: 00052 00053 orcadef::ProvidedDef &def_; 00054 orcadef::ProvidedCfg &cfg_; 00055 00056 void drawBubble( QPainter* p ); 00057 void setValid( bool yes ) {}; 00058 int maxConnections_; 00059 00060 static QPen _Pen; 00061 static QBrush _Brush; 00062 }; 00063 00064 } // namespace 00065 00066 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)