Ignore:
Timestamp:
2012-10-20T20:27:24+02:00 (12 years ago)
Author:
adeas31
Message:
  • Removed some old classes.
  • Better connection support for array type connectors.
  • Don't call getClassNames every time for searching of Modelica classes.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/OMEdit/OMEditGUI/LineAnnotation.h

    r13405 r13537  
    4242class RectangleCornerItem;
    4343class ShapeAnnotation;
    44 class Component_OMC;
     44class Component;
    4545
    46 class LineAnnotation_OMC : public ShapeAnnotation_OMC
     46class LineAnnotation : public ShapeAnnotation
    4747{
    4848  Q_OBJECT
    4949public:
    5050  enum geometryType {VERTICAL, HORIZONTAL, DIAGONAL};
    51   LineAnnotation_OMC(QString annotation, Component_OMC *pParent);
    52   LineAnnotation_OMC(Component_OMC *pStartComponent, GraphicsView *pGraphicsView);
     51  LineAnnotation(QString annotation, Component *pParent);
     52  LineAnnotation(Component *pStartComponent, GraphicsView *pGraphicsView);
    5353  void parseShapeAnnotation(QString annotation);
    5454  QPainterPath getShape() const;
     
    5959  QPolygonF drawArrow(QPointF startPos, QPointF endPos, qreal size, int arrowType) const;
    6060  QString getShapeAnnotation();
    61   void setStartComponent(Component_OMC *pStartComponent);
    62   Component_OMC* getStartComponent();
    63   void setEndComponent(Component_OMC *pEndComponent);
    64   Component_OMC* getEndComponent();
     61  void setStartComponent(Component *pStartComponent);
     62  Component* getStartComponent();
     63  void setEndComponent(Component *pEndComponent);
     64  Component* getEndComponent();
    6565  void addPoint(QPointF point);
    6666  void updateStartPoint(QPointF point);
    6767  void updateEndPoint(QPointF point);
    6868  void moveAllPoints(qreal offsetX, qreal offsetY);
     69  void setStartComponentName(QString name);
     70  QString getStartComponentName();
     71  void setEndComponentName(QString name);
     72  QString getEndComponentName();
    6973private:
    7074  QList<StringHandler::Arrow> mArrow;
    7175  qreal mArrowSize;
    7276  GraphicsView *mpGraphicsView;
    73   Component_OMC *mpStartComponent;
    74   Component_OMC *mpEndComponent;
     77  Component *mpStartComponent;
     78  QString mStartComponentName;
     79  Component *mpEndComponent;
     80  QString mEndComponentName;
    7581  QList<geometryType> mGeometries;
    7682public slots:
     
    7985};
    8086
    81 
    82 class LineAnnotation : public ShapeAnnotation
     87class ConnectionArray : public QDialog
    8388{
    8489  Q_OBJECT
    8590public:
    86   LineAnnotation(QString shape, Component *pParent);
    87   LineAnnotation(GraphicsView *graphicsView, QGraphicsItem *pParent = 0);
    88   LineAnnotation(QString shape, GraphicsView *graphicsView, QGraphicsItem *pParent = 0);
    89   QPainterPath getShape() const;
    90   QRectF boundingRect() const;
    91   QPainterPath shape() const;
    92   void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
    93   void drawLineAnnotaion(QPainter *painter);
    94   void addPoint(QPointF point);
    95   void updateEndPoint(QPointF point);
    96   void drawRectangleCornerItems();
    97   QString getShapeAnnotation();
    98   void parseShapeAnnotation(QString annotation);
    99   QPolygonF drawArrow(QPointF startPos, QPointF endPos, qreal size, int arrowType) const;
    100 
    101   Component *mpComponent;
     91  ConnectionArray(GraphicsView *pGraphicsView, LineAnnotation *pConnectionLineAnnotation, QWidget *pParent = 0);
     92private:
     93  GraphicsView *mpGraphicsView;
     94  LineAnnotation *mpConnectionLineAnnotation;
     95  Label *mpHeading;
     96  QFrame *mpHorizontalLine;
     97  Label *mpDescriptionLabel;
     98  Label *mpStartComponentLabel;
     99  QLineEdit *mpStartComponentTextBox;
     100  Label *mpEndComponentLabel;
     101  QLineEdit *mpEndComponentTextBox;
     102  QPushButton *mpOkButton;
     103  QPushButton *mpCancelButton;
     104  QDialogButtonBox *mpButtonBox;
    102105public slots:
    103   void updatePoint(int index, QPointF point);
     106  void saveArrayIndex();
     107  void cancelArrayIndex();
    104108};
    105109
Note: See TracChangeset for help on using the changeset viewer.