File indexing completed on 2024-07-14 05:32:31

0001 /***************************************************************************
0002  *   Copyright (C) 2005,2006 by David Saxton                               *
0003  *   david@bluehaze.org                                                    *
0004  *                                                                         *
0005  *   This program is free software; you can redistribute it and/or modify  *
0006  *   it under the terms of the GNU General Public License as published by  *
0007  *   the Free Software Foundation; either version 2 of the License, or     *
0008  *   (at your option) any later version.                                   *
0009  ***************************************************************************/
0010 
0011 #ifndef DPLINE_H
0012 #define DPLINE_H
0013 
0014 #include "drawpart.h"
0015 
0016 class LineOverlay;
0017 
0018 /**
0019 @author David Saxton
0020 */
0021 class DPLine : public DrawPart
0022 {
0023 public:
0024     DPLine(ItemDocument *itemDocument, bool newItem, const char *id = nullptr);
0025     ~DPLine() override;
0026 
0027     static Item *construct(ItemDocument *itemDocument, bool newItem, const char *id);
0028     static LibraryItem *libraryItem();
0029 
0030     void setSelected(bool yes) override;
0031 
0032 protected:
0033     void postResize() override;
0034     void dataChanged() override;
0035     void drawShape(QPainter &p) override;
0036 
0037     LineOverlay *m_pLineOverlay;
0038 };
0039 
0040 /**
0041 @author David Saxton
0042 */
0043 class DPArrow : public DPLine
0044 {
0045 public:
0046     DPArrow(ItemDocument *itemDocument, bool newItem, const char *id = nullptr);
0047     ~DPArrow() override;
0048 
0049     static Item *construct(ItemDocument *itemDocument, bool newItem, const char *id);
0050     static LibraryItem *libraryItem();
0051 
0052 protected:
0053     void dataChanged() override;
0054     void drawShape(QPainter &p) override;
0055     double m_headAngle;
0056 };
0057 
0058 #endif