VR-Forces 4.10 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) 2019 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 
38  class DtRangeEditorValueDelegate;
39 
43  : public QWidget , public DtRangeEditorInterface
44  { Q_OBJECT;
45  public:
46 
47  const static int theRangeStartColumn = 0;
48  const static int theRangeEndColumn = 1;
49  const static int theColorColumn = 2;
50 
51  public:
52 
54  DtRangeEditorWidget( DtDe& de, QWidget* parent = 0,
55  Qt::WindowFlags flags = 0 );
56 
58  virtual ~DtRangeEditorWidget();
59 
61  virtual void resizeEvent( QResizeEvent * event );
62 
64  virtual void clearGradient();
65 
67  virtual void setValueUnits( const QString& units );
68 
70  virtual void setValueDecimals( int decimals );
71 
73  virtual void setRangeBackgroundColor( const QColor& color );
74 
76  virtual QColor rangeBackgroundColor() const;
77 
79  virtual void getRange( int index, float& rangeStart, float& rangeEnd,
80  QColor& color ) const;
81 
83  virtual int numRanges() const;
84 
86  virtual void addControlPoint( double rangeStart, double rangeEnd,
87  double red, double green, double blue, double alpha = 1.0 );
88 
91  virtual void addControlPoint( const DtRangeEditorInterface::ControlPoint& cp );
92 
94  virtual void setGradient( DtRangeEditorInterface::Gradient grad );
95 
97  virtual DtRangeEditorInterface::Gradient gradient() const;
98 
100  virtual void removeControlPoint( int index );
101 
102  public slots:
103 
105  virtual void decorate();
106 
107  protected slots:
108 
111  virtual void insertNewControlPoint();
112 
115  virtual void removeSelectedControlPoint();
116 
118  virtual void updateGradient();
119 
120  protected:
121 
124  void setupGui();
125 
128  void connectToSignals();
129 
131  virtual void insertNewControlPoint( double rangeStart,
132  double rangeEnd, const QColor& color );
133 
135  std::string colorStringFromColor( const QColor& color );
136 
138  QList<QStandardItem*> modelRowFromAltitudeColor(
139  double rangeStart, double rangeEnd, std::string color );
140 
142  virtual void changeEvent( QEvent* event );
143 
144  protected:
145 
148 
150 
151  QAbstractItemDelegate* myColorDelegate;
152  DtRangeEditorValueDelegate* myValueDelegate;
153 
154  QStandardItemModel* myControlPointModel;
155  QGraphicsScene* myGradientScene;
156 
158  QGraphicsView* myGradientView;
161 
163 
164  };
165 
166 }
std::vector< double > ControlPoint
Vector type for the double values that make up a control point.
Definition: DtRangeEditorInterface.h:24
DtRangeEditorValueDelegate * myValueDelegate
Definition: DtRangeEditorWidget.h:152
QAbstractItemDelegate * myColorDelegate
Definition: DtRangeEditorWidget.h:151
#define DT_DLL_VRVCOREQT
Definition: vrvCoreQt.h:20
std::vector< DtRangeEditorInterface::ControlPoint > Gradient
Vector type for storing ControlPoints.
Definition: DtRangeEditorInterface.h:27
Contains DLL export macros.
QColor myBackgroundColor
Definition: DtRangeEditorWidget.h:149
QGraphicsView * myGradientView
Definition: DtRangeEditorWidget.h:158
QStandardItemModel * myControlPointModel
Definition: DtRangeEditorWidget.h:154
QPushButton * myAddControlPointButton
Definition: DtRangeEditorWidget.h:159
QPushButton * myRemoveControlPointButton
Definition: DtRangeEditorWidget.h:160
Contains the DtRangeEditorInterface declaration.
QString myRangeEndLabel
Definition: DtRangeEditorWidget.h:146
Abstract interface for range editor widgets.
Definition: DtRangeEditorInterface.h:19
A widget class for editing ranges.
Definition: DtRangeEditorWidget.h:42
Definition: translator.h:58
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
QString myRangeStartLabel
Definition: DtRangeEditorWidget.h:147
QTreeView * myControlPointView
Definition: DtRangeEditorWidget.h:157
QGraphicsScene * myGradientScene
Definition: DtRangeEditorWidget.h:155
makVrv::DtDe & myDe
Definition: DtRangeEditorWidget.h:162

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)