VR-Forces 4.1 Class Documentation
DtGradientEditorWidget.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 <QtGui/QWidget>
19 
20 class QTreeView;
21 class QPushButton;
22 class QStandardItem;
23 class QGraphicsView;
24 class QGraphicsScene;
25 class QStandardItemModel;
26 class QAbstractItemDelegate;
27 
28 namespace makVrv
29 {
30 
31  class DtDe;
32 
36  : public QWidget
38  {
39 
40  Q_OBJECT
41 
42  public:
43 
44  const static int theAltitudeColumn = 0;
45  const static int theDisplayColorColumn = 1;
46 
47  public:
48 
50  DtGradientEditorWidget( DtDe& de, QWidget* parent = 0,
51  Qt::WindowFlags flags = 0 );
52 
54  virtual ~DtGradientEditorWidget();
55 
57  virtual void resizeEvent( QResizeEvent * event );
58 
60  virtual void clearGradient();
61 
63  virtual void setAltitudeUnits( const QString& units );
64 
66  virtual void setAltitudeDecimals( int decimals );
67 
69  virtual void addControlPoint( double location, double red,
70  double green, double blue, double alpha = 1.0 );
71 
73  virtual void addControlPoint( DtGradientEditorInterface::ControlPoint cp );
74 
76  virtual void setGradient( DtGradientEditorInterface::Gradient grad );
77 
79  virtual const DtGradientEditorInterface::Gradient gradient() const;
80 
82  virtual void removeControlPoint( int index );
83 
84  public slots:
85 
87  virtual void decorate();
88 
89  protected slots:
90 
93  virtual void insertNewControlPoint();
94 
97  virtual void removeSelectedControlPoint();
98 
100  virtual void updateGradient();
101 
102  protected:
103 
106  void setupGui();
107 
110  void connectToSignals();
111 
113  virtual void insertNewControlPoint(double height, const QColor& color);
114 
116  std::string colorStringFromColor(const QColor& color);
117 
119  QList<QStandardItem*> modelRowFromAltitudeColor(double altitude, std::string color);
120 
121  protected:
122 
124 
125  QAbstractItemDelegate* myColorDelegate;
126  QAbstractItemDelegate* myAltitudeDelegate;
127 
128  QStandardItemModel* myControlPointModel;
129  QGraphicsScene* myGradientScene;
130 
132  QGraphicsView* myGradientView;
135 
137 
138  };
139 
140 }

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)