VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtRangeEditorWidget.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2012 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvCoreQt/vrvCoreQt.h>
13 
15 
16 #include <QtCore/QString>
17 
18 #include <QtWidgets/QWidget>
19 
20 class QAbstractItemDelegate;
21 class QStandardItemModel;
22 class QTreeWidgetItem;
23 class QGraphicsScene;
24 class QStandardItem;
25 class QItemDelegate;
26 class QGraphicsView;
27 class QActionGroup;
28 class QResizeEvent;
29 class QVBoxLayout;
30 class QTreeWidget;
31 class QPushButton;
32 class QTreeView;
33 class QMenu;
34 
35 namespace makVrv
36 {
37 
41  : public QWidget , public DtRangeEditorInterface
42  { Q_OBJECT;
43  public:
44 
45  const static int theRangeStartColumn = 0;
46  const static int theRangeEndColumn = 1;
47  const static int theColorColumn = 2;
48 
49  public:
50 
52  DtRangeEditorWidget( DtDe& de, QWidget* parent = 0,
53  Qt::WindowFlags flags = 0 );
54 
56  virtual ~DtRangeEditorWidget();
57 
59  virtual void resizeEvent( QResizeEvent * event );
60 
62  virtual void clearGradient();
63 
65  virtual void setValueUnits( const QString& units );
66 
68  virtual void setValueDecimals( int decimals );
69 
71  virtual void setRangeBackgroundColor( const QColor& color );
72 
74  virtual QColor rangeBackgroundColor() const;
75 
77  virtual void getRange( int index, float& rangeStart, float& rangeEnd,
78  QColor& color ) const;
79 
81  virtual int numRanges() const;
82 
84  virtual void addControlPoint( double rangeStart, double rangeEnd,
85  double red, double green, double blue, double alpha = 1.0 );
86 
89  virtual void addControlPoint( const DtRangeEditorInterface::ControlPoint& cp );
90 
92  virtual void setGradient( DtRangeEditorInterface::Gradient grad );
93 
95  virtual DtRangeEditorInterface::Gradient gradient() const;
96 
98  virtual void removeControlPoint( int index );
99 
100  public slots:
101 
103  virtual void decorate();
104 
105  protected slots:
106 
109  virtual void insertNewControlPoint();
110 
113  virtual void removeSelectedControlPoint();
114 
116  virtual void updateGradient();
117 
118  protected:
119 
122  void setupGui();
123 
126  void connectToSignals();
127 
129  virtual void insertNewControlPoint( double rangeStart,
130  double rangeEnd, const QColor& color );
131 
133  std::string colorStringFromColor( const QColor& color );
134 
136  QList<QStandardItem*> modelRowFromAltitudeColor(
137  double rangeStart, double rangeEnd, std::string color );
138 
140  virtual void changeEvent( QEvent* event );
141 
142  protected:
143 
146 
148 
149  QAbstractItemDelegate* myColorDelegate;
150  QAbstractItemDelegate* myValueDelegate;
151 
152  QStandardItemModel* myControlPointModel;
153  QGraphicsScene* myGradientScene;
154 
156  QGraphicsView* myGradientView;
159 
161 
162  };
163 
164 }

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)