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
|
link.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 ORCAQUML_LINK_H 00012 #define ORCAQUML_LINK_H 00013 00014 #include <QGraphicsItem> 00015 // #include <orcaquml/debuggable.h> 00016 00017 namespace orcaquml 00018 { 00019 00020 // a simple forward declaration will do here. 00021 // Interface on the other hand must include this header file to keep a list of links. 00022 class Interface; 00023 00024 class Link: public QGraphicsLineItem //, public QorcaDebuggable 00025 { 00026 public: 00027 Link( Interface* from, Interface* to ); 00028 00029 virtual int rtti () const { return 7777; }; 00030 00031 virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *item, QWidget *widget); 00032 00033 void prepareToDie(); 00034 00035 void setFromInterface( Interface* p ) { from_ = p; }; 00036 void setToInterface( Interface* p ) { to_ = p; }; 00037 00038 void setFromPoint( double x, double y ) ; 00039 void setToPoint( double x, double y ); 00040 00041 void setSelected( bool yes ); 00042 void setLabel(); 00043 00044 // void getFromInterfaceConfig( QDomElement &conf ); 00045 // void getToInterfaceConfig( QDomElement &conf ); 00046 00047 void getFromInterfaceNaming( QString & platform, QString & name ); 00048 void getToInterfaceNaming( QString & platform, QString & name ); 00049 00050 void moveBy(double dx, double dy) {}; 00051 void placeLabelAuto(); 00052 00053 static void toggleSignature() { _showInterfaceName = !_showInterfaceName; }; 00054 00055 // virtual const std::string description() const { return "link"; } 00056 00057 private: 00058 00059 Interface* from_; 00060 Interface* to_; 00061 00062 QGraphicsSimpleTextItem *label_; 00063 00064 static bool _showInterfaceName; 00065 00066 static QPen _defaultPen; 00067 static QPen _selectedPen; 00068 00069 }; 00070 00071 } 00072 00073 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)