QvisSaveWindow.h 7.24 KB
Newer Older
hrchilds's avatar
hrchilds committed
1 2
/*****************************************************************************
*
3
* Copyright (c) 2000 - 2014, Lawrence Livermore National Security, LLC
hrchilds's avatar
hrchilds committed
4
* Produced at the Lawrence Livermore National Laboratory
5
* LLNL-CODE-442911
hrchilds's avatar
hrchilds committed
6 7
* All rights reserved.
*
8
* This file is  part of VisIt. For  details, see https://visit.llnl.gov/.  The
hrchilds's avatar
hrchilds committed
9 10 11 12 13 14 15 16 17 18
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution  and  use  in  source  and  binary  forms,  with  or  without
* modification, are permitted provided that the following conditions are met:
*
*  - Redistributions of  source code must  retain the above  copyright notice,
*    this list of conditions and the disclaimer below.
*  - Redistributions in binary form must reproduce the above copyright notice,
*    this  list of  conditions  and  the  disclaimer (as noted below)  in  the
19 20 21
*    documentation and/or other materials provided with the distribution.
*  - Neither the name of  the LLNS/LLNL nor the names of  its contributors may
*    be used to endorse or promote products derived from this software without
hrchilds's avatar
hrchilds committed
22 23 24 25 26
*    specific prior written permission.
*
* 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
27 28 29
* ARE  DISCLAIMED. IN  NO EVENT  SHALL LAWRENCE  LIVERMORE NATIONAL  SECURITY,
* LLC, THE  U.S.  DEPARTMENT OF  ENERGY  OR  CONTRIBUTORS BE  LIABLE  FOR  ANY
* DIRECT,  INDIRECT,   INCIDENTAL,   SPECIAL,   EXEMPLARY,  OR   CONSEQUENTIAL
hrchilds's avatar
hrchilds committed
30 31 32 33 34 35 36 37 38
* 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.
*
*****************************************************************************/

hrchilds's avatar
hrchilds committed
39 40 41 42 43 44 45 46 47 48 49
#ifndef QVIS_SAVE_WINDOW_H
#define QVIS_SAVE_WINDOW_H
#include <gui_exports.h>
#include <QvisPostableWindowObserver.h>

// Forward declarations.
class QCheckBox;
class QComboBox;
class QGroupBox;
class QLabel;
class QLineEdit;
hrchilds's avatar
hrchilds committed
50
class QPushButton;
hrchilds's avatar
hrchilds committed
51 52
class QSlider;
class SaveWindowAttributes;
53 54
class QRadioButton;
class QButtonGroup;
hrchilds's avatar
hrchilds committed
55
class QvisOpacitySlider;
hrchilds's avatar
hrchilds committed
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78

// ****************************************************************************
// Class: QvisSaveWindow
//
// Purpose:
//   This class contains the code necessary to create a window that
//   observes the save image attributes.
//
// Notes:      
//
// Programmer: Brad Whitlock
// Creation:   Fri Feb 9 16:46:07 PST 2001
//
// Modifications:
//   Brad Whitlock, Wed Jan 23 15:13:23 PST 2002
//   Added quality and progressive toggles.
//
//   Hank Childs, Fri May 24 07:45:52 PDT 2002
//   Renamed SaveImageAtts to SaveWindowAtts.  Added support for STL.
//
//   Hank Childs, Sun May 26 17:31:18 PDT 2002
//   Added a toggle for binary vs ASCII.
//
hrchilds's avatar
hrchilds committed
79 80 81
//   Kathleen Bonnell, Thu Nov 13 12:14:30 PST 2003 
//   Added combo box for compression type. 
//
hrchilds's avatar
hrchilds committed
82 83 84
//   Brad Whitlock, Fri Jul 30 15:14:44 PST 2004
//   Added save path and a slot to save the image.
//
hrchilds's avatar
hrchilds committed
85 86 87
//   Kathleen Bonnell, Wed Dec 15 08:20:11 PST 2004 
//   Added slot 'saveButtonClicked'. 
//
hrchilds's avatar
hrchilds committed
88 89 90
//   Jeremy Meredith, Thu Apr  5 17:23:37 EDT 2007
//   Added button to force a merge of parallel geometry.
//
91 92 93
//   Brad Whitlock, Wed Apr  9 10:56:15 PDT 2008
//   QString for caption, shortName.
//
hrchilds's avatar
hrchilds committed
94 95 96 97
//   Hank Childs, Thu Jul 22 09:55:03 PDT 2010
//   Added support for multi-window saves.  Also re-orged window some to
//   put check boxes close to the functionality they go with.
//
98 99 100
//   Brad Whitlock, Wed Aug 25 13:32:46 PDT 2010
//   I moved some code into helper methods.
//
hrchilds's avatar
hrchilds committed
101 102 103 104 105 106
// ****************************************************************************

class GUI_API QvisSaveWindow : public QvisPostableWindowObserver
{
    Q_OBJECT
public:
107 108 109
    QvisSaveWindow(SaveWindowAttributes *subj, 
                   const QString &caption = QString::null,
                   const QString &shortName = QString::null,
hrchilds's avatar
hrchilds committed
110 111 112 113 114 115 116 117 118
                   QvisNotepadArea *notepad = 0);
    virtual ~QvisSaveWindow();
public slots:
    virtual void apply();
protected:
    virtual void CreateWindowContents();
    void UpdateWindow(bool doAll);
    void GetCurrentValues(int which_widget);
    void Apply(bool ignore = false);
119 120 121

    QWidget *StandardTab(QWidget *);
    QWidget *AdvancedTab(QWidget *);
hrchilds's avatar
hrchilds committed
122
protected slots:
hrchilds's avatar
hrchilds committed
123 124
    void outputToCurrentDirectoryToggled(bool);
    void processOutputDirectoryText();
hrchilds's avatar
hrchilds committed
125 126
    void processFilenameText();
    void familyToggled(bool);
hrchilds's avatar
hrchilds committed
127
    void stereoToggled(bool);
hrchilds's avatar
hrchilds committed
128
    void fileFormatChanged(int);
129
    void resConstraintToggled(bool);
hrchilds's avatar
hrchilds committed
130 131 132 133 134 135 136
    void processWidthText();
    void processHeightText();
    void progressiveToggled(bool);
    void binaryToggled(bool);
    void qualityChanged(int);
    void screenCaptureToggled(bool);
    void saveTiledToggled(bool);
hrchilds's avatar
hrchilds committed
137
    void compressionTypeChanged(int);
hrchilds's avatar
hrchilds committed
138 139
    void saveWindow();
    void selectOutputDirectory();
hrchilds's avatar
hrchilds committed
140
    void saveButtonClicked();
hrchilds's avatar
hrchilds committed
141
    void forceMergeToggled(bool);
hrchilds's avatar
hrchilds committed
142 143 144 145 146 147 148 149 150 151 152 153
    void advancedMultiWinSaveToggled(bool);
    void processmwsWidthText();
    void processmwsHeightText();
    void mwsWindowComboBoxChanged(int);
    void processmwsIndWidthText();
    void processmwsIndHeightText();
    void processmwsPosXText();
    void processmwsPosYText();
    void mwsLayerComboBoxChanged(int);
    void omitWindowCheckBoxToggled(bool);
    void imageTransparencyChanged(int);

hrchilds's avatar
hrchilds committed
154
private:
hrchilds's avatar
hrchilds committed
155 156
    int currentWindow;

hrchilds's avatar
hrchilds committed
157 158 159 160
    QCheckBox           *outputToCurrentDirectoryCheckBox;
    QLabel              *outputDirectoryLabel;
    QLineEdit           *outputDirectoryLineEdit;
    QPushButton         *outputDirectorySelectButton;
hrchilds's avatar
hrchilds committed
161 162
    QLineEdit           *filenameLineEdit;
    QCheckBox           *familyCheckBox;
hrchilds's avatar
hrchilds committed
163
    QCheckBox           *stereoCheckBox;
hrchilds's avatar
hrchilds committed
164
    QCheckBox           *stereoCheckBox2;
hrchilds's avatar
hrchilds committed
165 166 167
    QComboBox           *fileFormatComboBox;
    QLabel              *qualityLabel;
    QSlider             *qualitySlider;
hrchilds's avatar
hrchilds committed
168 169
    QLabel              *compressionTypeLabel;
    QComboBox           *compressionTypeComboBox;
hrchilds's avatar
hrchilds committed
170 171 172
    QCheckBox           *progressiveCheckBox;
    QCheckBox           *binaryCheckBox;
    QGroupBox           *resolutionBox;
173 174 175 176
    QButtonGroup        *resConstraintButtonGroup;
    QRadioButton        *noResButton;
    QRadioButton        *oneToOneResButton;
    QRadioButton        *screenResButton;
hrchilds's avatar
hrchilds committed
177 178 179 180
    QLineEdit           *widthLineEdit;
    QLineEdit           *heightLineEdit;
    QCheckBox           *screenCaptureCheckBox;
    QCheckBox           *saveTiledCheckBox;
hrchilds's avatar
hrchilds committed
181
    QCheckBox           *forceMergeCheckBox;
hrchilds's avatar
hrchilds committed
182 183 184 185 186 187 188 189 190 191 192 193
    QCheckBox           *advancedMultiWinSaveCheckBox;
    QLineEdit           *mwsWidthLineEdit;
    QLineEdit           *mwsHeightLineEdit;
    QComboBox           *mwsWindowComboBox;
    QLineEdit           *mwsIndWidthLineEdit;
    QLineEdit           *mwsIndHeightLineEdit;
    QLineEdit           *mwsPosXLineEdit;
    QLineEdit           *mwsPosYLineEdit;
    QComboBox           *mwsLayerComboBox;
    QCheckBox           *omitWindowCheckBox;
    QvisOpacitySlider   *imageTransparency;

hrchilds's avatar
hrchilds committed
194 195 196 197
    SaveWindowAttributes  *saveWindowAtts;
};

#endif