QvisPseudocolorPlotWindow.h 9.16 KB
Newer Older
hrchilds's avatar
hrchilds committed
1 2
/*****************************************************************************
*
brugger's avatar
 
brugger committed
3
* Copyright (c) 2000 - 2013, Lawrence Livermore National Security, LLC
hrchilds's avatar
hrchilds committed
4
* Produced at the Lawrence Livermore National Laboratory
brugger's avatar
 
brugger committed
5
* LLNL-CODE-442911
hrchilds's avatar
hrchilds committed
6 7
* All rights reserved.
*
brugger's avatar
 
brugger committed
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
brugger's avatar
 
brugger committed
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
brugger's avatar
 
brugger committed
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
#ifndef QVIS_PSEUDOCOLOR_WINDOW_H
#define QVIS_PSEUDOCOLOR_WINDOW_H
#include <QvisPostableWindowObserver.h>

43
class QGroupBox;
hrchilds's avatar
hrchilds committed
44 45 46 47 48 49
class QComboBox;
class QLineEdit;
class QCheckBox;
class QButtonGroup;
class QLabel;
class QvisOpacitySlider;
50
class QvisColorTableWidget;
hrchilds's avatar
hrchilds committed
51
class QvisPointControl;
52 53
class QvisLineStyleWidget;
class QvisLineWidthWidget;
54 55
class QvisVariableButton;
class QSpinBox;
hrchilds's avatar
hrchilds committed
56 57 58 59

class Subject;
class PseudocolorAttributes;

allens's avatar
allens committed
60 61
class QvisCollapsibleStack;

hrchilds's avatar
hrchilds committed
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
// ****************************************************************************
// Class: QvisPseudocolorPlotWindow
//
// Purpose:
//   This class is a postable window that watches pseudocolot plot
//   attributes and always represents their current state.
//
// Notes:      
//
// Programmer: Brad Whitlock
// Creation:   Fri Jul 28 17:16:38 PST 2000
//
// Modifications:
//   Kathleen Bonnell, Thu Dec 14 17:04:25 PST 2000
//   Added support for setting opacity.
//
//   Eric Brugger, Wed Mar 14 06:59:25 PST 2001
//   I added a plot type to the constructor for use with the viewer
//   proxy.
//
//   Brad Whitlock, Sat Jun 16 15:17:12 PST 2001
//   I added a color table button.
//
//   Kathleen Bonnell, Thu Oct  4 16:28:16 PDT 2001 
//   I added a limits combo box.
//
//   Brad Whitlock, Fri Feb 15 10:27:55 PDT 2002
//   Removed a method.
//
//   Jeremy Meredith, Tue Dec 10 10:22:40 PST 2002
//   Added smoothing level.
//
//   Jeremy Meredith, Fri Dec 20 11:36:03 PST 2002
//   Added scaling of point variables by a scalar field.
//
hrchilds's avatar
hrchilds committed
97 98 99 100
//   Kathleen Bonnell, Fri Nov 12 11:25:23 PST 2004 
//   Replace individual point-size related widgets and associated slots
//   with QvisPointControl 
//
hrchilds's avatar
hrchilds committed
101 102 103
//   Brad Whitlock, Wed Jul 20 14:23:58 PST 2005
//   Added a new slot to handle a new signal from QvisPointControl.
//
104 105 106
//   Jeremy Meredith, Wed Nov 26 11:28:24 EST 2008
//   Added line style/width controls.
//
js9's avatar
js9 committed
107 108 109 110 111
//   Jeremy Meredith, Fri Feb 20 15:14:29 EST 2009
//   Added support for using per-color alpha values from a color table
//   (instead of just a single global opacity for the whole plot).
//   There's a new toggle for this, and it overrides the whole-plot opacity.
//
112 113 114
//   Allen Sanderson, Sun Mar  7 12:49:56 PST 2010
//   Change layout of window for 2.0 interface changes.
//
115 116 117
//   Kathleen Bonnell, Mon Jan 17 18:02:39 MST 2011
//   Change colorTableButton to colorTableWidget to gain invert toggle.
//
hrchilds's avatar
hrchilds committed
118 119 120 121 122 123 124
// ****************************************************************************

class QvisPseudocolorPlotWindow : public QvisPostableWindowObserver
{
    Q_OBJECT
public:
    QvisPseudocolorPlotWindow(const int type, PseudocolorAttributes *_pcAtts,
125 126
                              const QString &caption = QString::null,
                              const QString &shortName = QString::null,
hrchilds's avatar
hrchilds committed
127 128 129 130 131 132 133 134
                              QvisNotepadArea *notepad = 0);
    virtual ~QvisPseudocolorPlotWindow();
    virtual void CreateWindowContents();
public slots:
    virtual void apply();
    virtual void makeDefault();
    virtual void reset();
protected:
135 136 137 138 139

    void CreateGeometryTab(QWidget *);
    void CreateDataTab(QWidget *);
    void CreateExtrasTab(QWidget *);

hrchilds's avatar
hrchilds committed
140 141 142 143
    void UpdateWindow(bool doAll);
    void GetCurrentValues(int which_widget);
    void Apply(bool ignore = false);
private slots:
144 145 146 147 148

    void scaleClicked(int scale);
    void processSkewText();

    void limitsSelectChanged(int);
hrchilds's avatar
hrchilds committed
149 150 151 152
    void minToggled(bool on);
    void maxToggled(bool on);
    void processMaxLimitText();
    void processMinLimitText();
153 154 155

    void centeringClicked(int button);

hrchilds's avatar
hrchilds committed
156
    void colorTableClicked(bool useDefault, const QString &ctName);
157
    void invertColorTableToggled(bool val);
hrchilds's avatar
hrchilds committed
158

159 160 161 162 163 164 165 166 167 168
    void opacityTypeChanged(int val);
    void opacityVariableChanged(const QString &var);
    void opacityChanged(int opacity, const void*);

    void opacityMinToggled(bool);
    void opacityMaxToggled(bool);
    void processOpacityVarMin();
    void processOpacityVarMax();

    void pointTypeChanged(int index);
hrchilds's avatar
hrchilds committed
169
    void pointSizeChanged(double d);
hrchilds's avatar
hrchilds committed
170
    void pointSizePixelsChanged(int size);
hrchilds's avatar
hrchilds committed
171
    void pointSizeVarToggled(bool on);
hrchilds's avatar
hrchilds committed
172
    void pointSizeVarChanged(const QString &);
hrchilds's avatar
hrchilds committed
173

174
    void lineTypeChanged(int newType);
175 176 177
    void lineStyleChanged(int newStyle);
    void lineWidthChanged(int newWidth);

178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198
    void tubeDisplayDensityChanged(int val);
    void tubeRadiusSizeTypeChanged(int v);
    void tubeRadiusProcessText();
    void tubeRadiusVaryChanged(bool val);
    void tubeRadiusVaryVariableChanged(const QString &var);
    void tubeRadiusVaryFactorProcessText();

    void endPointTypeChanged(int newType);
    void endPointStyleChanged(int newStyle);
    void endPointRadiusSizeTypeChanged(int v);
    void endPointRadiusProcessText();
    void endPointRatioProcessText();

    void smoothingLevelChanged(int index);
    void renderSurfacesChanged(bool);
    void renderWireframeChanged(bool);
    void renderPointsChanged(bool);

    void legendToggled(bool on);
    void lightingToggled(bool on);

hrchilds's avatar
hrchilds committed
199 200 201
private:
    int                   plotType;
    PseudocolorAttributes *pcAtts;
202

allens's avatar
allens committed
203 204
    QvisCollapsibleStack  *propertyStack;

205 206 207 208
    QButtonGroup          *scalingButtons;
    QLineEdit             *skewLineEdit;

    QComboBox             *limitsSelect;
hrchilds's avatar
hrchilds committed
209 210 211 212
    QCheckBox             *minToggle;
    QCheckBox             *maxToggle;
    QLineEdit             *maxLineEdit;
    QLineEdit             *minLineEdit;
213 214 215

    QButtonGroup          *centeringButtons;

216
    QvisColorTableWidget  *colorTableWidget;
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231

    QComboBox *opacityType;
    QLabel    *opacityVarLabel;
    QvisVariableButton *opacityVar;
    QvisOpacitySlider *opacitySlider;
    QGroupBox *opacityMinMaxGroup;
    QCheckBox *opacityMinToggle;
    QCheckBox *opacityMaxToggle;
    QLineEdit *opacityVarMin;
    QLineEdit *opacityVarMax;

    // QButtonGroup          *opacityButtons;
    // QLabel                *opacitySliderLabel;
    // QvisOpacitySlider     *opacitySlider;

hrchilds's avatar
hrchilds committed
232
    QvisPointControl      *pointControl;
233 234 235

    QComboBox             *lineType;

236 237 238 239
    QLabel                *lineStyleLabel;
    QvisLineStyleWidget   *lineStyle;
    QLabel                *lineWidthLabel;
    QvisLineWidthWidget   *lineWidth;
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272


    QLabel             *tubeDisplayDensityLabel;
    QSpinBox           *tubeDisplayDensity;
    QLabel             *tubeRadiusLabel;
    QLineEdit          *tubeRadius;
    QComboBox          *tubeRadiusSizeType;

    QCheckBox          *tubeRadiusVary;
    QLabel             *tubeRadiusVaryVariableLabel;
    QvisVariableButton *tubeRadiusVaryVariable;
    QLabel             *tubeRadiusVaryFactorLabel;
    QLineEdit          *tubeRadiusVaryFactorEdit;
  
    // QLineEdit *ribbonWidth;
    // QComboBox *ribbonSizeType;

    QComboBox *endPointType;
    QLabel    *endPointStyleLabel;
    QComboBox *endPointStyle;
    QLabel    *endPointRadiusLabel;
    QLineEdit *endPointRadius;
    QComboBox *endPointRadiusSizeType;
    QLabel    *endPointRatioLabel;
    QLineEdit *endPointRatio;

    QButtonGroup          *smoothingLevelButtons;
    QCheckBox             *renderSurfaces;
    QCheckBox             *renderWireframe;
    QCheckBox             *renderPoints;

    QCheckBox             *legendToggle;
    QCheckBox             *lightingToggle;
hrchilds's avatar
hrchilds committed
273 274
};
#endif