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
|
required.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_REQUIRED_H 00012 #define ORCAQUML_REQUIRED_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 Required: public Interface 00022 { 00023 public: 00024 Required( Component* parent, 00025 QGraphicsScene* scene, 00026 orcadef::RequiredDef &def, 00027 orcadef::RequiredCfg &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_.proxy ); }; 00033 00034 bool isClient() const { return true; }; 00035 void checkValid(); 00036 bool isHidable() const { return !isNecessary_ && !isLinked(); }; 00037 00038 // void writeConfig( QDomElement & ); 00039 // void getConfig( QDomElement & ); 00040 void setLabel(); 00041 00042 void linkEvent( Interface &toInterface ); 00043 00044 virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *item, QWidget *widget); 00045 00046 virtual int rtti () const { return RTTI_REQUIRED_INTERFACE; }; 00047 00048 // Returns a human-readable description (useful for debugging) 00049 // virtual const std::string description() const; 00050 00051 private: 00052 00053 orcadef::RequiredDef &def_; 00054 orcadef::RequiredCfg &cfg_; 00055 00056 void drawBubble( QPainter* p ); 00057 void setValid( bool yes ); 00058 00059 bool isNecessary_; 00060 00061 static QPen _validPen; 00062 static QBrush _validBrush; 00063 static QPen _invalidPen; 00064 static QBrush _invalidBrush; 00065 }; 00066 00067 } // namespace 00068 00069 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)