VR-Forces 4.2 Class Documentation
tmMiniMap.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2001 MAK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: tmMiniMap.h,v $ $Revision: 1.26 $ $State: Exp $
7 *********************************************************************/
8 
11 
12 #ifndef TMMINIMAP_H
13 #define TMMINIMAP_H
14 
15 #include "tmqt/tmArea.h"
16 
17 #include "tmqt/tmRubberBand.h"
18 
19 #include <QtGui/QPixmap>
20 
21 
22 
23 class DtTMWindow;
24 class DtTMMapArea;
25 
33 
34 #include "tmqt/tmqtDefines.h"
36 {
37  Q_OBJECT
38 
39 public:
40 
42  DtTMMiniMap(QWidget* parent = 0, const Qt::WindowFlags& f = 0);
43 
45  virtual ~DtTMMiniMap();
46 
48  virtual bool init(const DtTMFactory* f);
49 
51  virtual bool showingRubberBands() const;
52 
54  virtual void setShowingRubberBands(bool onOff);
55 
57  virtual QSize minimumSizeHint() const;
58  virtual QSize sizeHint() const;
59 
60  //Rubber bands represent an area (usually another view)
61  //When you ask to add a Rubber band the function returns an identifying
62  //integer that you can use to identify it when the signals come back.
63  //There is one active rubber band, specified with setActiveMap
64  //This is the one that gets resized when you move the mouse around
65  //if you want no resize/move, just setActiveMap to 0.
66  virtual DtTMRubberBand* addRubberBand
67  (
68  const DtTMFactory* f,
69  const DtTMMiniMap* m,
70  const DtTMMapArea* a,
71  double pctX = 0,
72  double pctY = 0,
73  double pctWidth = 1,
74  double pctHeight = 1,
75  QPen* activePen = 0,
76  QPen* inactivePen = 0
77  );
78 
82  virtual const QPen& activePen() const;
83 
85  virtual void setActivePen(const QPen& p);
86 
90  virtual const QPen& inactivePen() const;
91 
93  virtual void setInactivePen(const QPen& p);
94 
95  //set the Inactive color of the pen. Also resets all previus
96  //rubber bands to that color
97  virtual void setActiveColor(const QColor& c);
98 
99  //set the Inactive color of the pen. Also resets all previus
100  //rubber bands to that color
101  virtual void setInactiveColor(const QColor& c);
102 
103 public:
104 
106  static DtTMMiniMap* create(QWidget* parent, const Qt::WindowFlags& f);
107 
108 signals:
109 
111  void activeRubberBandSet(const DtTMRubberBand*);
112 
113 public slots:
114 
116  virtual void setActiveRubberBand(DtTMRubberBand*);
117 
118  //Take a rubber band out of the equation.
119  //Note: the QObject should be of type DtTMRubberBand
121  virtual void removeRubberBand(QObject*);
122 
123  virtual void drawRubberBands(QPainter* p);
124 
125 protected:
126 
128  DtTMMiniMap(const DtTMMiniMap& orig);
129 
131  DtTMMiniMap& operator=(const DtTMMiniMap& orig);
132 
134  virtual void mouseReleaseEvent(QMouseEvent* e);
135  virtual void mousePressEvent(QMouseEvent* e);
136  virtual void mouseMoveEvent(QMouseEvent* e);
137  virtual void resizeEvent(QResizeEvent* e);
138 
140 
141  virtual void clipPoint(QPoint& point);
142 
143  virtual void clipRect(QRect& rect);
144 
145  virtual void reorderRectangle(QRect& rect);
146 
147  virtual void resizeRectToFitAspectRatio(QRect& r, const double& ratio);
148 
150  virtual bool needsDrawOrder() const;
151 
152 protected:
155 
158 
160 
163 
164 };
165 
166 #endif

Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)