ParaView
pqCameraDialog.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: pqCameraDialog.h
5 
6  Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
7  All rights reserved.
8 
9  ParaView is a free software; you can redistribute it and/or modify it
10  under the terms of the ParaView license version 1.2.
11 
12  See License_v1.2.txt for the full ParaView license.
13  A copy of this license can be obtained by contacting
14  Kitware Inc.
15  28 Corporate Drive
16  Clifton Park, NY 12065
17  USA
18 
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
23 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 =========================================================================*/
32 #ifndef pqCameraDialog_h
33 #define pqCameraDialog_h
34 
35 #include "pqDialog.h"
36 
37 class pqCameraDialogInternal;
38 class pqView;
39 
40 class PQCOMPONENTS_EXPORT pqCameraDialog : public pqDialog
41 {
42  Q_OBJECT
43 public:
44  pqCameraDialog(QWidget* parent = NULL, Qt::WindowFlags f = 0);
45  virtual ~pqCameraDialog();
46 
47  void SetCameraGroupsEnabled(bool enabled);
48 
49 public slots:
50  void setRenderModule(pqView*);
51 
52 private slots:
53  // Description:
54  // Choose a file and load/save camera properties.
55  void saveCameraConfiguration();
56  void loadCameraConfiguration();
57 
58  // Description:
59  // Assign/restore the current camera properties to
60  // a custom view button.
61  void configureCustomViews();
62  void applyCustomView(int buttonId);
63  void applyCustomView0() { this->applyCustomView(0); }
64  void applyCustomView1() { this->applyCustomView(1); }
65  void applyCustomView2() { this->applyCustomView(2); }
66  void applyCustomView3() { this->applyCustomView(3); }
67 
68  void resetViewDirectionPosX();
69  void resetViewDirectionNegX();
70  void resetViewDirectionPosY();
71  void resetViewDirectionNegY();
72  void resetViewDirectionPosZ();
73  void resetViewDirectionNegZ();
74 
75  void resetViewDirection(
76  double look_x, double look_y, double look_z, double up_x, double up_y, double up_z);
77 
78  void applyCameraRoll();
79  void applyCameraElevation();
80  void applyCameraAzimuth();
81 
82  void resetRotationCenterWithCamera();
83 
84  void setInteractiveViewLinkOpacity(double value);
85  void setInteractiveViewLinkBackground(bool hideBackground);
86  void updateInteractiveViewLinkWidgets();
87 
88 protected:
89  void setupGUI();
90 
91 private:
92  pqCameraDialogInternal* Internal;
93 
94  enum CameraAdjustmentType
95  {
96  Roll = 0,
97  Elevation,
98  Azimuth
99  };
100  void adjustCamera(CameraAdjustmentType enType, double angle);
101 };
102 
103 #endif
This is a PQ abstraction of a generic view module.
Definition: pqView.h:56
This is a QDialog subclass that is aware of the undo-redo sub-system.
Definition: pqDialog.h:53