pqDefaultViewBehavior.h 2.43 KB
Newer Older
1
2
/*=========================================================================

Andy Cedilnik's avatar
Andy Cedilnik committed
3
   Program: ParaView
4
   Module:    pqDefaultViewBehavior.h
5

6
   Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
7
8
   All rights reserved.

Andy Cedilnik's avatar
Andy Cedilnik committed
9
   ParaView is a free software; you can redistribute it and/or modify it
Kitware Robot's avatar
Kitware Robot committed
10
11
   under the terms of the ParaView license version 1.2.

12
   See License_v1.2.txt for the full ParaView license.
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   A copy of this license can be obtained by contacting
   Kitware Inc.
   28 Corporate Drive
   Clifton Park, NY 12065
   USA

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

31
========================================================================*/
32
33
#ifndef pqDefaultViewBehavior_h
#define pqDefaultViewBehavior_h
34

35
#include "pqApplicationComponentsModule.h"
36
#include <QObject>
37
38
#include <QPointer>

39
#include "pqTimer.h" // for pqTimer
40
#include "vtkType.h" // for vtkTypeUInt32.
41

42
class pqServer;
Clinton Stimpson's avatar
Clinton Stimpson committed
43

44
45
46
47
48
49
/**
* @ingroup Behaviors
* pqDefaultViewBehavior ensures that when a new server connection is made,
* the default view of the user-specified type is automatically created.
* This also has the logic to warn before server connection timesout.
*/
50
class PQAPPLICATIONCOMPONENTS_EXPORT pqDefaultViewBehavior : public QObject
51
{
52
53
  Q_OBJECT
  typedef QObject Superclass;
Kitware Robot's avatar
Kitware Robot committed
54

55
public:
Kitware Robot's avatar
Kitware Robot committed
56
  pqDefaultViewBehavior(QObject* parent = 0);
57

58
protected Q_SLOTS:
59
  void onServerCreation(pqServer*);
60
  void createView(pqServer*);
61
62
  void fiveMinuteTimeoutWarning();
  void finalTimeoutWarning();
63

64
  void showWarnings();
Kitware Robot's avatar
Kitware Robot committed
65

66
private:
67
  Q_DISABLE_COPY(pqDefaultViewBehavior)
68

69
70
71
  vtkTypeUInt32 ServerCapabilities;
  vtkTypeUInt32 ClientCapabilities;
  QPointer<pqServer> Server;
72
  pqTimer WarningsTimer;
73
74
75
  pqTimer ViewCreationTimer;
  bool EnvironmentComplete = false;
  QPointer<pqServer> CurrentServer;
76
77
78
};

#endif