VAPOR3 3.9.4
VizWinMgr.h
Go to the documentation of this file.
1//************************************************************************
2// *
3// Copyright (C) 2004 *
4// University Corporation for Atmospheric Research *
5// All Rights Reserved *
6// *
7//************************************************************************/
8//
9// File: VizWinMgr.h
10//
11// Author: Alan Norton
12// National Center for Atmospheric Research
13// PO 3000, Boulder, Colorado
14//
15// Date: Sept 2004
16//
17
18#ifndef VIZWINMGR_H
19#define VIZWINMGR_H
20
21class QMdiArea;
22class QMdiSubWindow;
23class QWidget;
24
26#include <qobject.h>
27#include <vapor/common.h>
28#include <vapor/ParamsMgr.h>
32
33class VizWin;
34class Trackball;
35
42
48//
49class VizWinMgr : public QObject {
50 Q_OBJECT
51
52public:
53 VizWinMgr(QWidget *parent, QMdiArea *mdiArea, VAPoR::ControlExec *ce);
54
56
60 //
61 void Shutdown();
62
66 //
67 void Restart();
68
69 void SetTrackBall(const double posvec[3], const double dirvec[3], const double upvec[3], const double centerRot[3], bool perspective);
70
72 void Update(bool fast);
73
75 int EnableImageCapture(string filename, string winName);
76
77 VizWin *Get(const std::string &name) { return _vizWindow[name]; }
78
79public slots:
80
86
88 void Cascade();
89
91 void FitSpace();
92
94 void SetWinActive(const QString &vizName);
95
96 void Reinit();
97
98private slots:
99
100 // Set a Visualizer to be the active (selected) Visualizer
101 // \param[in] vizNum index of Visualizer to be activated.
102 void _setActiveViz(string winName);
103
106 void _vizAboutToDisappear(string winName);
107
108 // Method that responds to completion of window navigation
109 //
110 void _syncViewpoints(string winName);
111
112signals:
113 // Turn on/off multiple viz options:
114 //
115 void enableMultiViz(bool onOff);
116
117 // Respond to user setting the vizselectorcombo:
118 //
119 void newViz(const QString &);
120
121 void removeViz(const QString &);
122
123 void activateViz(const QString &);
124
125private:
126 // Can't call default constructor
127 //
128 VizWinMgr();
129
130 std::map<string, VizWin *> _vizWindow;
131 std::map<string, QMdiSubWindow *> _vizMdiWin;
132
133 QMdiArea *_mdiArea;
134
135 QWidget * _parent;
136 VAPoR::ControlExec *_controlExec;
137 Trackball * _trackBall;
138 bool _initialized;
139 bool _insideRender = false;
140
141 void _attachVisualizer(string vizName);
142
143 GUIStateParams *_getStateParams() const
144 {
145 VAssert(_controlExec != NULL);
146 VAPoR::ParamsMgr *paramsMgr = _controlExec->GetParamsMgr();
147 return ((GUIStateParams *)paramsMgr->GetParams(GUIStateParams::GetClassType()));
148 }
149
150 AnimationParams *_getAnimationParams() const
151 {
152 VAssert(_controlExec != NULL);
153 VAPoR::ParamsMgr *paramsMgr = _controlExec->GetParamsMgr();
155 }
156
157 VAPoR::ViewpointParams *_getViewpointParams(string winName) const
158 {
159 VAssert(_controlExec != NULL);
160 VAPoR::ParamsMgr *paramsMgr = _controlExec->GetParamsMgr();
161 return (paramsMgr->GetViewpointParams(winName));
162 }
163
164 vector<string> _getVisualizerNames() const;
165 void _killViz(string vizName);
166};
167#endif // VIZWINMGR_H
#define VAssert(expr)
Definition: VAssert.h:9
A class that specifies parameters used in animation.
static string GetClassType()
static string GetClassType()
Provides API for VAPOR visualizer User Interfaces (UIs)
ParamsMgr * GetParamsMgr() const
A singleton class for managing Params instances.
Definition: ParamsMgr.h:53
ViewpointParams * GetViewpointParams(string winName) const
ParamsBase * GetParams(string classType)
Definition: ParamsMgr.h:371
A class for describing the viewpoint and lights in a 3D VAPOR scene.
A class for managing all visualizers.
Definition: VizWinMgr.h:49
void SetTrackBall(const double posvec[3], const double dirvec[3], const double upvec[3], const double centerRot[3], bool perspective)
void Update(bool fast)
Invoke updateGL on all the visualizers that have dirty bit set.
void activateViz(const QString &)
void Cascade()
Arrange the Visualizers in a cascading sequence.
VizWin * Get(const std::string &name)
Definition: VizWinMgr.h:77
int EnableImageCapture(string filename, string winName)
void Restart()
void Reinit()
void SetWinActive(const QString &vizName)
Respond to user request to activate a window:
void LaunchVisualizer()
void removeViz(const QString &)
void newViz(const QString &)
void enableMultiViz(bool onOff)
void FitSpace()
Arrange the visualizers to tile the available space.
void Shutdown()
VizWinMgr(QWidget *parent, QMdiArea *mdiArea, VAPoR::ControlExec *ce)
A QGLWidget that supports display based on GL methods invoked in a Visualizer.
Definition: VizWin.h:60