QvisInverseGhostZoneWindow.C 10.1 KB
Newer Older
hrchilds's avatar
hrchilds committed
1 2
/*****************************************************************************
*
bonnell's avatar
bonnell committed
3
* Copyright (c) 2000 - 2015, 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
#include "QvisInverseGhostZoneWindow.h"
hrchilds's avatar
hrchilds committed
40 41 42 43

#include <InverseGhostZoneAttributes.h>
#include <ViewerProxy.h>

whitlocb's avatar
whitlocb committed
44 45 46 47 48 49 50
#include <QCheckBox>
#include <QLabel>
#include <QLayout>
#include <QLineEdit>
#include <QSpinBox>
#include <QButtonGroup>
#include <QRadioButton>
hrchilds's avatar
hrchilds committed
51 52 53 54 55
#include <QvisColorTableButton.h>
#include <QvisOpacitySlider.h>
#include <QvisColorButton.h>
#include <QvisLineStyleWidget.h>
#include <QvisLineWidthWidget.h>
whitlocb's avatar
whitlocb committed
56 57
#include <QvisVariableButton.h>

hrchilds's avatar
hrchilds committed
58 59 60 61 62
#include <stdio.h>
#include <string>

using std::string;

hrchilds's avatar
hrchilds committed
63 64 65 66
// ****************************************************************************
// Method: QvisInverseGhostZoneWindow::QvisInverseGhostZoneWindow
//
// Purpose: 
hrchilds's avatar
hrchilds committed
67
//   Constructor
hrchilds's avatar
hrchilds committed
68
//
whitlocb's avatar
whitlocb committed
69 70
// Note:       Autogenerated by xml2window.
//
hrchilds's avatar
hrchilds committed
71
// Programmer: xml2window
whitlocb's avatar
whitlocb committed
72
// Creation:   omitted
hrchilds's avatar
hrchilds committed
73 74 75 76 77 78
//
// Modifications:
//   
// ****************************************************************************

QvisInverseGhostZoneWindow::QvisInverseGhostZoneWindow(const int type,
hrchilds's avatar
hrchilds committed
79
                         InverseGhostZoneAttributes *subj,
80 81
                         const QString &caption,
                         const QString &shortName,
hrchilds's avatar
hrchilds committed
82 83
                         QvisNotepadArea *notepad)
    : QvisOperatorWindow(type,subj, caption, shortName, notepad)
hrchilds's avatar
hrchilds committed
84
{
hrchilds's avatar
hrchilds committed
85
    atts = subj;
hrchilds's avatar
hrchilds committed
86 87
}

hrchilds's avatar
hrchilds committed
88

hrchilds's avatar
hrchilds committed
89 90 91 92
// ****************************************************************************
// Method: QvisInverseGhostZoneWindow::~QvisInverseGhostZoneWindow
//
// Purpose: 
hrchilds's avatar
hrchilds committed
93
//   Destructor
hrchilds's avatar
hrchilds committed
94
//
whitlocb's avatar
whitlocb committed
95 96
// Note:       Autogenerated by xml2window.
//
hrchilds's avatar
hrchilds committed
97
// Programmer: xml2window
whitlocb's avatar
whitlocb committed
98
// Creation:   omitted
hrchilds's avatar
hrchilds committed
99 100 101 102 103 104 105 106 107
//
// Modifications:
//   
// ****************************************************************************

QvisInverseGhostZoneWindow::~QvisInverseGhostZoneWindow()
{
}

hrchilds's avatar
hrchilds committed
108

hrchilds's avatar
hrchilds committed
109 110 111 112
// ****************************************************************************
// Method: QvisInverseGhostZoneWindow::CreateWindowContents
//
// Purpose: 
hrchilds's avatar
hrchilds committed
113
//   Creates the widgets for the window.
hrchilds's avatar
hrchilds committed
114
//
whitlocb's avatar
whitlocb committed
115 116
// Note:       Autogenerated by xml2window.
//
hrchilds's avatar
hrchilds committed
117
// Programmer: xml2window
whitlocb's avatar
whitlocb committed
118
// Creation:   omitted
hrchilds's avatar
hrchilds committed
119 120
//
// Modifications:
121
//   
hrchilds's avatar
hrchilds committed
122 123 124 125 126
// ****************************************************************************

void
QvisInverseGhostZoneWindow::CreateWindowContents()
{
whitlocb's avatar
whitlocb committed
127 128
    QGridLayout *mainLayout = new QGridLayout(0);
    topLayout->addLayout(mainLayout);
hrchilds's avatar
hrchilds committed
129

130 131 132 133 134
    requestGhostZones = new QCheckBox(tr("Request Ghost Zones"), central);
    connect(requestGhostZones, SIGNAL(toggled(bool)),
            this, SLOT(requestGhostZonesChanged(bool)));
    mainLayout->addWidget(requestGhostZones, 0,0);

135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
    showDuplicated = new QCheckBox(tr("Show Zones That Are Duplicated At Domain Boundaries"), central);
    connect(showDuplicated, SIGNAL(toggled(bool)),
            this, SLOT(showDuplicatedChanged(bool)));
    mainLayout->addWidget(showDuplicated, 1,0);

    showEnhancedConnectivity = new QCheckBox(tr("Show Enhanced Connectivity Zones"), central);
    connect(showEnhancedConnectivity, SIGNAL(toggled(bool)),
            this, SLOT(showEnhancedConnectivityChanged(bool)));
    mainLayout->addWidget(showEnhancedConnectivity, 2,0);

    showReducedConnectivity = new QCheckBox(tr("Show Reduced Connectivity Zones"), central);
    connect(showReducedConnectivity, SIGNAL(toggled(bool)),
            this, SLOT(showReducedConnectivityChanged(bool)));
    mainLayout->addWidget(showReducedConnectivity, 3,0);

    showAMRRefined = new QCheckBox(tr("Show zones refined out by finer patches (AMR)"), central);
    connect(showAMRRefined, SIGNAL(toggled(bool)),
            this, SLOT(showAMRRefinedChanged(bool)));
    mainLayout->addWidget(showAMRRefined, 4,0);

    showExterior = new QCheckBox(tr("Show cells on exterior of data set"), central);
    connect(showExterior, SIGNAL(toggled(bool)),
            this, SLOT(showExteriorChanged(bool)));
    mainLayout->addWidget(showExterior, 5,0);

    showNotApplicable = new QCheckBox(tr("Show zones deemed not applicable to problem"), central);
    connect(showNotApplicable, SIGNAL(toggled(bool)),
            this, SLOT(showNotApplicableChanged(bool)));
    mainLayout->addWidget(showNotApplicable, 6,0);
hrchilds's avatar
hrchilds committed
164

hrchilds's avatar
hrchilds committed
165 166
}

hrchilds's avatar
hrchilds committed
167

hrchilds's avatar
hrchilds committed
168 169 170 171
// ****************************************************************************
// Method: QvisInverseGhostZoneWindow::UpdateWindow
//
// Purpose: 
hrchilds's avatar
hrchilds committed
172
//   Updates the widgets in the window when the subject changes.
hrchilds's avatar
hrchilds committed
173
//
whitlocb's avatar
whitlocb committed
174 175
// Note:       Autogenerated by xml2window.
//
hrchilds's avatar
hrchilds committed
176
// Programmer: xml2window
whitlocb's avatar
whitlocb committed
177
// Creation:   omitted
hrchilds's avatar
hrchilds committed
178 179
//
// Modifications:
whitlocb's avatar
whitlocb committed
180
//   
hrchilds's avatar
hrchilds committed
181 182 183 184 185
// ****************************************************************************

void
QvisInverseGhostZoneWindow::UpdateWindow(bool doAll)
{
whitlocb's avatar
whitlocb committed
186

hrchilds's avatar
hrchilds committed
187
    for(int i = 0; i < atts->NumAttributes(); ++i)
hrchilds's avatar
hrchilds committed
188 189 190
    {
        if(!doAll)
        {
hrchilds's avatar
hrchilds committed
191 192 193 194
            if(!atts->IsSelected(i))
            {
                continue;
            }
hrchilds's avatar
hrchilds committed
195 196 197 198
        }

        switch(i)
        {
199 200 201 202 203
          case InverseGhostZoneAttributes::ID_requestGhostZones:
            requestGhostZones->blockSignals(true);
            requestGhostZones->setChecked(atts->GetRequestGhostZones());
            requestGhostZones->blockSignals(false);
            break;
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232
          case InverseGhostZoneAttributes::ID_showDuplicated:
            showDuplicated->blockSignals(true);
            showDuplicated->setChecked(atts->GetShowDuplicated());
            showDuplicated->blockSignals(false);
            break;
          case InverseGhostZoneAttributes::ID_showEnhancedConnectivity:
            showEnhancedConnectivity->blockSignals(true);
            showEnhancedConnectivity->setChecked(atts->GetShowEnhancedConnectivity());
            showEnhancedConnectivity->blockSignals(false);
            break;
          case InverseGhostZoneAttributes::ID_showReducedConnectivity:
            showReducedConnectivity->blockSignals(true);
            showReducedConnectivity->setChecked(atts->GetShowReducedConnectivity());
            showReducedConnectivity->blockSignals(false);
            break;
          case InverseGhostZoneAttributes::ID_showAMRRefined:
            showAMRRefined->blockSignals(true);
            showAMRRefined->setChecked(atts->GetShowAMRRefined());
            showAMRRefined->blockSignals(false);
            break;
          case InverseGhostZoneAttributes::ID_showExterior:
            showExterior->blockSignals(true);
            showExterior->setChecked(atts->GetShowExterior());
            showExterior->blockSignals(false);
            break;
          case InverseGhostZoneAttributes::ID_showNotApplicable:
            showNotApplicable->blockSignals(true);
            showNotApplicable->setChecked(atts->GetShowNotApplicable());
            showNotApplicable->blockSignals(false);
hrchilds's avatar
hrchilds committed
233 234
            break;
        }
hrchilds's avatar
hrchilds committed
235
    }
hrchilds's avatar
hrchilds committed
236 237 238 239
}


// ****************************************************************************
hrchilds's avatar
hrchilds committed
240
// Method: QvisInverseGhostZoneWindow::GetCurrentValues
hrchilds's avatar
hrchilds committed
241 242
//
// Purpose: 
hrchilds's avatar
hrchilds committed
243
//   Gets values from certain widgets and stores them in the subject.
hrchilds's avatar
hrchilds committed
244
//
whitlocb's avatar
whitlocb committed
245 246
// Note:       Autogenerated by xml2window.
//
hrchilds's avatar
hrchilds committed
247
// Programmer: xml2window
whitlocb's avatar
whitlocb committed
248
// Creation:   omitted
hrchilds's avatar
hrchilds committed
249 250 251 252 253 254
//
// Modifications:
//   
// ****************************************************************************

void
hrchilds's avatar
hrchilds committed
255
QvisInverseGhostZoneWindow::GetCurrentValues(int which_widget)
hrchilds's avatar
hrchilds committed
256 257
{
}
hrchilds's avatar
hrchilds committed
258 259 260 261 262 263 264


//
// Qt Slot functions
//


265 266 267 268 269 270 271 272 273
void
QvisInverseGhostZoneWindow::requestGhostZonesChanged(bool val)
{
    atts->SetRequestGhostZones(val);
    SetUpdate(false);
    Apply();
}


hrchilds's avatar
hrchilds committed
274
void
275
QvisInverseGhostZoneWindow::showDuplicatedChanged(bool val)
hrchilds's avatar
hrchilds committed
276
{
277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324
    atts->SetShowDuplicated(val);
    SetUpdate(false);
    Apply();
}


void
QvisInverseGhostZoneWindow::showEnhancedConnectivityChanged(bool val)
{
    atts->SetShowEnhancedConnectivity(val);
    SetUpdate(false);
    Apply();
}


void
QvisInverseGhostZoneWindow::showReducedConnectivityChanged(bool val)
{
    atts->SetShowReducedConnectivity(val);
    SetUpdate(false);
    Apply();
}


void
QvisInverseGhostZoneWindow::showAMRRefinedChanged(bool val)
{
    atts->SetShowAMRRefined(val);
    SetUpdate(false);
    Apply();
}


void
QvisInverseGhostZoneWindow::showExteriorChanged(bool val)
{
    atts->SetShowExterior(val);
    SetUpdate(false);
    Apply();
}


void
QvisInverseGhostZoneWindow::showNotApplicableChanged(bool val)
{
    atts->SetShowNotApplicable(val);
    SetUpdate(false);
    Apply();
hrchilds's avatar
hrchilds committed
325 326 327
}