QvisClipWindow.C 36.6 KB
Newer Older
hrchilds's avatar
hrchilds committed
1 2
/*****************************************************************************
*
bonnell's avatar
bonnell committed
3
* Copyright (c) 2000 - 2017, 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.
*
*****************************************************************************/

whitlocb's avatar
whitlocb committed
39 40 41 42 43 44 45 46 47
#include <QButtonGroup>
#include <QCheckBox>
#include <QGroupBox>
#include <QWidget>
#include <QVBoxLayout>
#include <QLabel>
#include <QLineEdit>
#include <QRadioButton>
#include <QWidget>
hrchilds's avatar
hrchilds committed
48 49 50 51

#include <QvisClipWindow.h>
#include <ClipAttributes.h>

whitlocb's avatar
whitlocb committed
52 53 54 55 56 57 58 59 60 61 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 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 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 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
// ****************************************************************************
// Method: QPlaneGroup::QPlaneGroup
//
// Purpose: 
//   Constructor for the QPlaneGroup class.
//
// Arguments:
//   title    : Group Title
//   parent   : Optional QWidget parent.
//
// Programmer: Cyrus Harrison
// Creation:   Thu Aug 21 14:17:04 PDT 2008
//
// Modifications:
//
// ****************************************************************************
QPlaneGroup::QPlaneGroup(const QString &title, QWidget *parent)
: QGroupBox(title,parent)
{
    setCheckable(true);
    QGridLayout *layout = new QGridLayout(this);
    origin = new QLineEdit(this);
    normal = new QLineEdit(this);
    layout->addWidget(new QLabel(tr("Origin")),0,0);
    layout->addWidget(origin,0,1);
    layout->addWidget(new QLabel(tr("Normal")),1,0);
    layout->addWidget(normal,1,1);
        
    connect(origin,SIGNAL(returnPressed()),
            this,SIGNAL(OriginChanged()));
        
    connect(normal,SIGNAL(returnPressed()),
            this,SIGNAL(NormalChanged()));
}

// ****************************************************************************
// Method: QPlaneGroup::~QPlaneGroup
//
// Purpose: 
//   Destructor for the QPlaneGroup class.
//
//
// Programmer: Cyrus Harrison
// Creation:   Thu Aug 21 14:17:04 PDT 2008
//
// Modifications:
//
// ****************************************************************************
QPlaneGroup::~QPlaneGroup()
{}

// ****************************************************************************
// Method: QPlaneGroup::SetOrigin
//
// Purpose: 
//   Sets the plane origin.
//
// Arguments:
//        val origin point location.
//
// Programmer: Cyrus Harrison
// Creation:   Thu Aug 21 14:17:04 PDT 2008
//
// Modifications:
//
// ****************************************************************************
void 
QPlaneGroup::SetOrigin(double val[3])
{
    origin->blockSignals(true);
    origin->setText(GUIBase::DoublesToQString(val,3));
    origin->blockSignals(false);
}
 
// ****************************************************************************
// Method: QPlaneGroup::SetNormal
//
// Purpose: 
//   Sets the plane normal.
//
// Arguments:
//        val normal vector value.
//
// Programmer: Cyrus Harrison
// Creation:   Thu Aug 21 14:17:04 PDT 2008
//
// Modifications:
//
// ****************************************************************************   
void 
QPlaneGroup::SetNormal(double val[3])
{
    normal->blockSignals(true);
    normal->setText(GUIBase::DoublesToQString(val,3));
    normal->blockSignals(false);
}
   
// ****************************************************************************
// Method: QPlaneGroup::GetOrigin
//
// Purpose: 
//   Trys to parse the plane origin from input line edit.
//   
// Returns:
//   True if the input line edit contains 3 doubles.
//
// Arguments:
//        val output for plane origin point.
//
// Programmer: Cyrus Harrison
// Creation:   Thu Aug 21 14:17:04 PDT 2008
//
// Modifications:
//
// ****************************************************************************    
bool
QPlaneGroup::GetOrigin(double val[3])
{
    return GUIBase::LineEditGetDoubles(origin, val, 3);
}

// ****************************************************************************
// Method: QPlaneGroup::GetNormal
//
// Purpose: 
//   Trys to parse the plane normal from input line edit.
//   
// Returns:
//   True if the input line edit contains 3 doubles.
//
// Arguments:
//        val output for plane normal vector.
//
// Programmer: Cyrus Harrison
// Creation:   Thu Aug 21 14:17:04 PDT 2008
//
// Modifications:
//
// ****************************************************************************    
bool 
QPlaneGroup::GetNormal(double val[3])
{
    return GUIBase::LineEditGetDoubles(normal, val, 3);
}

hrchilds's avatar
hrchilds committed
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219

// ****************************************************************************
// Method: QvisClipWindow::QvisClipWindow
//
// Purpose: 
//   Constructor for the QvisClipWindow class.
//
// Arguments:
//   subj      : The ClipAttributes object that the window observes.
//   caption   : The string that appears in the window decoration.
//   shortName : The name to use when the window is posted.
//   notepad   : The notepad widget to which the window posts.
//
// Programmer: Kathleen Bonnell
// Creation:   May 7, 2001 
//
// Modifications:
//   Brad Whitlock, Fri Apr 12 13:05:23 PST 2002
//   Made it inherit from QvisOperatorWindow.
//
// ****************************************************************************

QvisClipWindow::QvisClipWindow(const int type,
220
    ClipAttributes *subj, const QString &caption, const QString &shortName,
hrchilds's avatar
hrchilds committed
221 222 223
    QvisNotepadArea *notepad) :
    QvisOperatorWindow(type, subj, caption, shortName, notepad)
{
whitlocb's avatar
whitlocb committed
224
    atts = subj;
hrchilds's avatar
hrchilds committed
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263
}

// ****************************************************************************
// Method: QvisClipWindow::~QvisClipWindow
//
// Purpose: 
//   This is the destructor for the QvisClipWindow class.
//
// Programmer: Kathleen Bonnell
// Creation:   May 7, 2001
//
// Modifications:
//   
// ****************************************************************************

QvisClipWindow::~QvisClipWindow()
{
}

// ****************************************************************************
// Method: QvisClipWindow::CreateWindowContents
//
// Purpose: 
//   This method creates the widgets for the Clip operator window.
//
// Programmer: Kathleen Bonnell
// Creation:   May 7, 2001 
//
// Modifications:
//
//   Kathleen Bonnell, Tue Jun  5 15:11:09 PDT 2001
//   Use one temp label for all labels (removes compile warning).
//   Reduced spacing between parts. Removed code that set current
//   page for tabWidget.
//   
//   Kathleen Bonnell, Tue Apr  2 16:44:30 PST 2002 
//   Removed UMR's that came about from labels setting a 'buddy' widget
//   before that widget had been created. 
//   
hrchilds's avatar
hrchilds committed
264 265 266 267
//   Kathleen Bonnell, Mon Dec  6 14:35:14 PST 2004 
//   Changed plane*Status from groupButton to checkable QVGroupBox.  Modified
//   connect statements accordingly.
//
hrchilds's avatar
hrchilds committed
268 269 270 271 272 273
//   Brad Whitlock, Tue Dec 21 09:13:49 PDT 2004
//   Moved code into CreatePlaneGroup so it would be easier to add Qt
//   version-specific coding so we can still use versions older than 3.2. I
//   also changed how the Inverse buttons are created so they are more in 
//   line with how we create other check boxes.
//
274 275 276
//   Gunther H. Weber, Tue Aug 14 19:46:03 PDT 2007
//   Added radio buttons to select clip plane manipulated by plane tool
//
277 278 279 280
//   Sean Ahern, Wed Feb 27 16:17:11 EST 2008
//   Added 'fast' vs. 'accurate' quality options.  I also removed the tab
//   widget, as it shouldn't be used in the way it was.
//
281 282 283
//   Brad Whitlock, Fri Apr 25 09:34:26 PDT 2008
//   Added tr()'s
//
whitlocb's avatar
whitlocb committed
284 285 286
//   Cyrus Harrison, Thu Aug 21 09:48:43 PDT 2008
//   Qt4 Port.
//
287 288 289
//   Jeremy Meredith, Fri Apr  3 10:19:16 EDT 2009
//   Added missing connections for plane toggles.
//
hrchilds's avatar
hrchilds committed
290 291 292 293 294
// ****************************************************************************

void
QvisClipWindow::CreateWindowContents()
{
whitlocb's avatar
whitlocb committed
295 296 297 298 299 300 301 302 303 304 305 306 307 308
    
    QWidget *qualityWidget= new QWidget(central);
    qualityGroup = new QButtonGroup(qualityWidget);
    
    QHBoxLayout *qualityLayout = new QHBoxLayout(qualityWidget);
    qualityLayout->setMargin(0);
    
    QRadioButton *fastQuality = new QRadioButton("Fast", qualityWidget);
    QRadioButton *accurateQuality = new QRadioButton(tr("Accurate"), qualityWidget);
    
    qualityLayout->addWidget(new QLabel(tr("Quality:"), qualityWidget));
    qualityGroup->addButton(fastQuality,0);
    qualityGroup->addButton(accurateQuality,1);
    
309 310
    qualityLayout->addWidget(fastQuality);
    qualityLayout->addWidget(accurateQuality);
whitlocb's avatar
whitlocb committed
311 312 313
    
    topLayout->addWidget(qualityWidget);
    connect(qualityGroup, SIGNAL(buttonClicked(int)),
314 315
            this, SLOT(qualityChanged(int)));

whitlocb's avatar
whitlocb committed
316 317 318 319 320 321 322 323 324 325
    
    QWidget *typeWidget = new QWidget(central);
    typeGroup = new QButtonGroup(typeWidget);
    
    QHBoxLayout  *typeLayout = new QHBoxLayout(typeWidget);
    typeLayout->setMargin(0);
    QRadioButton *planeType = new QRadioButton(tr("Plane"), typeWidget);
    QRadioButton *sphereType = new QRadioButton(tr("Sphere"), typeWidget);
    
    typeLayout->addWidget(new QLabel(tr("Slice type:"), typeWidget));
326 327
    typeLayout->addWidget(planeType);
    typeLayout->addWidget(sphereType);
whitlocb's avatar
whitlocb committed
328 329 330 331 332 333
    topLayout->addWidget(typeWidget);

    typeGroup->addButton(planeType,0);
    typeGroup->addButton(sphereType,1);
    
    connect(typeGroup, SIGNAL(buttonClicked(int)),
334 335
            this, SLOT(sliceTypeChanged(int)));

whitlocb's avatar
whitlocb committed
336 337
    QGroupBox *frame = new QGroupBox(tr("Clip parameters"),central);
    QVBoxLayout *frameLayout = new QVBoxLayout(frame);
338
    topLayout->addWidget(frame);
whitlocb's avatar
whitlocb committed
339 340 341 342 343
    
    planeWidgets = new QWidget(frame);
    
    frameLayout->addWidget(planeWidgets);
    QVBoxLayout *planeWidgetsLayout = new QVBoxLayout(planeWidgets);
hrchilds's avatar
hrchilds committed
344

hrchilds's avatar
hrchilds committed
345
    // 
346
    // Plane widgets 
hrchilds's avatar
hrchilds committed
347
    // 
whitlocb's avatar
whitlocb committed
348 349 350 351 352 353 354
    
    plane1Group = new QPlaneGroup(tr("Plane 1"),planeWidgets);
    plane2Group = new QPlaneGroup(tr("Plane 2"),planeWidgets);
    plane3Group = new QPlaneGroup(tr("Plane 3"),planeWidgets);
    planeWidgetsLayout->addWidget(plane1Group);
    planeWidgetsLayout->addWidget(plane2Group);
    planeWidgetsLayout->addWidget(plane3Group);
355 356 357 358 359 360
    connect(plane1Group, SIGNAL(toggled(bool)),
            this, SLOT(plane1StatusToggled(bool)));
    connect(plane2Group, SIGNAL(toggled(bool)),
            this, SLOT(plane2StatusToggled(bool)));
    connect(plane3Group, SIGNAL(toggled(bool)),
            this, SLOT(plane3StatusToggled(bool)));
whitlocb's avatar
whitlocb committed
361
        
hrchilds's avatar
hrchilds committed
362
    // Plane Inverse
whitlocb's avatar
whitlocb committed
363
    planeInverse = new QCheckBox(tr("Inverse"), planeWidgets);
hrchilds's avatar
hrchilds committed
364
    planeInverse->setChecked(false);
hrchilds's avatar
hrchilds committed
365 366
    connect(planeInverse, SIGNAL(toggled(bool)),
            this, SLOT(planeInverseToggled(bool)));
whitlocb's avatar
whitlocb committed
367 368
    planeWidgetsLayout->addWidget(planeInverse);
            
369
    // Plane tool controls
whitlocb's avatar
whitlocb committed
370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393
    QLabel *planeToolControlledClipPlaneLabel = new QLabel(tr("Plane tool controls:"), planeWidgets);
    
    planeToolControlledClipPlane = new QButtonGroup(planeWidgets);
    QWidget *planeToolControlledClipPlaneWidget = new QWidget(planeWidgets);
    planeWidgetsLayout->addWidget(planeToolControlledClipPlaneLabel);
    planeWidgetsLayout->addWidget(planeToolControlledClipPlaneWidget);
    
    QHBoxLayout *planeToolControlledClipPlaneLayout = new QHBoxLayout(planeToolControlledClipPlaneWidget);
    planeToolControlledClipPlaneLayout->setMargin(0);
    
    QRadioButton *planeToolControlledClipPlaneWhichClipPlaneNone = new QRadioButton(tr("Nothing"),          
                                                                                    planeToolControlledClipPlaneWidget);
    
    
    QRadioButton *planeToolControlledClipPlaneWhichClipPlanePlane1 = new QRadioButton(tr("Plane 1"), 
                                                                                      planeToolControlledClipPlaneWidget);
    
    
    QRadioButton *planeToolControlledClipPlaneWhichClipPlanePlane2 = new QRadioButton(tr("Plane 2"), 
                                                                                      planeToolControlledClipPlaneWidget);
    
    QRadioButton *planeToolControlledClipPlaneWhichClipPlanePlane3 = new QRadioButton(tr("Plane 3"), 
                                                                                      planeToolControlledClipPlaneWidget);
    
394 395
    planeToolControlledClipPlaneLayout->addWidget(planeToolControlledClipPlaneWhichClipPlaneNone);
    planeToolControlledClipPlaneLayout->addWidget(planeToolControlledClipPlaneWhichClipPlanePlane1);
whitlocb's avatar
whitlocb committed
396
    planeToolControlledClipPlaneLayout->addWidget(planeToolControlledClipPlaneWhichClipPlanePlane2);
397
    planeToolControlledClipPlaneLayout->addWidget(planeToolControlledClipPlaneWhichClipPlanePlane3);
whitlocb's avatar
whitlocb committed
398 399 400 401 402 403 404
    
    planeToolControlledClipPlane->addButton(planeToolControlledClipPlaneWhichClipPlaneNone,0);
    planeToolControlledClipPlane->addButton(planeToolControlledClipPlaneWhichClipPlanePlane1,1);
    planeToolControlledClipPlane->addButton(planeToolControlledClipPlaneWhichClipPlanePlane2,2);
    planeToolControlledClipPlane->addButton(planeToolControlledClipPlaneWhichClipPlanePlane3,3);
    
    connect(planeToolControlledClipPlane, SIGNAL(buttonClicked(int)),
405 406
            this, SLOT(planeToolControlledClipPlaneChanged(int)));
 
hrchilds's avatar
hrchilds committed
407
    // 
408
    // Sphere widgets
hrchilds's avatar
hrchilds committed
409
    // 
whitlocb's avatar
whitlocb committed
410 411 412 413 414 415
    
    sphereWidgets = new QWidget(frame);
    frameLayout->addWidget(sphereWidgets);
    
    QGridLayout *sphereLayout = new QGridLayout(sphereWidgets);
    
hrchilds's avatar
hrchilds committed
416
    // Sphere center
whitlocb's avatar
whitlocb committed
417
    sphereLayout->addWidget(new QLabel(tr("Center"), sphereWidgets),
418
                            0, 0, Qt::AlignRight);
whitlocb's avatar
whitlocb committed
419
    centerLineEdit = new QLineEdit(sphereWidgets);
420
    sphereLayout->addWidget(centerLineEdit, 0, 1);
hrchilds's avatar
hrchilds committed
421 422 423 424
    connect(centerLineEdit, SIGNAL(returnPressed()),
            this, SLOT(processCenterText()));

    // Sphere Radius 
whitlocb's avatar
whitlocb committed
425
    sphereLayout->addWidget(new QLabel(tr("Radius"), sphereWidgets),
426
                            1, 0, Qt::AlignRight);
whitlocb's avatar
whitlocb committed
427
    radiusLineEdit = new QLineEdit(sphereWidgets);
428
    sphereLayout->addWidget(radiusLineEdit, 1, 1);
hrchilds's avatar
hrchilds committed
429 430 431 432
    connect(radiusLineEdit, SIGNAL(returnPressed()),
            this, SLOT(processRadiusText()));

    // Sphere Inverse
whitlocb's avatar
whitlocb committed
433
    sphereInverse = new QCheckBox(tr("Inverse"), sphereWidgets);
hrchilds's avatar
hrchilds committed
434
    sphereInverse->setChecked(false);
whitlocb's avatar
whitlocb committed
435
    sphereLayout->addWidget(sphereInverse, 2, 0, 1, 2);
hrchilds's avatar
hrchilds committed
436 437
    connect(sphereInverse, SIGNAL(toggled(bool)),
            this, SLOT(sphereInverseToggled(bool)));
hrchilds's avatar
hrchilds committed
438 439
}

hrchilds's avatar
hrchilds committed
440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466

// ****************************************************************************
// Method: QvisClipWindow::UpdateWindow
//
// Purpose: 
//   This method updates the window's widgets to reflect changes made
//   in the ClipAttributes object that the window watches.
//
// Arguments:
//   doAll : A flag indicating whether to update all of the widgets
//           regardless of the ClipAttribute object's selected
//           states.
//
// Programmer: Kathleen Bonnell
// Creation:   May 7, 2001 
//
// Modifications:
//   Kathleen Bonnell, Tue Jun  5 15:11:09 PDT 2001
//   Fleshed out the update for FuncType so that window gets updated
//   properly.
//   
//   Jeremy Meredith, Fri Aug 17 13:45:17 PDT 2001
//   Fixed a copy and paste typo.
//
//   Brad Whitlock, Fri Feb 15 11:53:47 PDT 2002
//   Fixed format strings.
//
hrchilds's avatar
hrchilds committed
467 468 469 470
//   Jeremy Meredith, Tue Nov 16 11:39:53 PST 2004
//   Replaced simple QString::sprintf's with a setNum because there seems
//   to be a bug causing numbers to be incremented by .00001.  See '5263.
//
hrchilds's avatar
hrchilds committed
471 472 473 474
//   Kathleen Bonnell, Mon Dec  6 14:35:14 PST 2004 
//   plane*Status widgets are now QVGroupBoxes, modify set method calls
//   accordingly. 
//
hrchilds's avatar
hrchilds committed
475 476 477
//   Brad Whitlock, Tue Dec 21 09:54:20 PDT 2004
//   I added code to block signals for checkboxes.
//
478 479 480 481
//   Gunther H. Weber, Tue Aug 14 19:46:03 PDT 2007
//   Added code to handle radio buttons to select clip plane manipulated by
//   plane tool
//
whitlocb's avatar
whitlocb committed
482 483
//   Cyrus Harrison, Thu Aug 21 09:48:43 PDT 2008
//   Qt4 Port.
484
//
485 486 487 488 489 490
//   Jeremy Meredith, Wed Jan 27 10:00:24 EST 2010
//   Fix bug.  Signals were not blocked properly when setting values
//   when clip function type was changed.  But we don't need to set
//   those values when the function type is changed, since we're just
//   hiding or showing existing widgets, so I stopeed that.
//
491 492 493
//   Jeremy Meredith, Wed Jan 27 12:34:08 EST 2010
//   Add extra, potentially necessary signal block.
//
hrchilds's avatar
hrchilds committed
494 495 496 497 498 499 500 501 502
// ****************************************************************************

void
QvisClipWindow::UpdateWindow(bool doAll)
{

    // Loop through all the attributes and do something for
    // each of them that changed. This function is only responsible
    // for displaying the state values and setting widget sensitivity.
whitlocb's avatar
whitlocb committed
503
    for(int i = 0; i < atts->NumAttributes(); ++i)
hrchilds's avatar
hrchilds committed
504 505 506
    {
        if(!doAll)
        {
whitlocb's avatar
whitlocb committed
507
            if(!atts->IsSelected(i))
hrchilds's avatar
hrchilds committed
508 509 510 511 512 513 514
            {
                continue;
            }
        }

        switch(i)
        {
whitlocb's avatar
whitlocb committed
515
        case ClipAttributes::ID_funcType:
516
            typeGroup->blockSignals(true);
whitlocb's avatar
whitlocb committed
517
            typeGroup->button(atts->GetFuncType())->setChecked(true);
518
            typeGroup->blockSignals(false);
whitlocb's avatar
whitlocb committed
519
            if (atts->GetFuncType() == ClipAttributes::Plane)
hrchilds's avatar
hrchilds committed
520
            {
521 522
                sphereWidgets->hide();
                planeWidgets->show();
hrchilds's avatar
hrchilds committed
523
            }
whitlocb's avatar
whitlocb committed
524
            else if (atts->GetFuncType() == ClipAttributes::Sphere)
hrchilds's avatar
hrchilds committed
525
            {
526 527
                planeWidgets->hide();
                sphereWidgets->show();
hrchilds's avatar
hrchilds committed
528
            }
529
            central->updateGeometry();
hrchilds's avatar
hrchilds committed
530
            break;
whitlocb's avatar
whitlocb committed
531 532 533 534
        case ClipAttributes::ID_plane1Status:
            plane1Group->blockSignals(true);
            plane1Group->setChecked(atts->GetPlane1Status());
            plane1Group->blockSignals(false);
hrchilds's avatar
hrchilds committed
535
            break;
whitlocb's avatar
whitlocb committed
536 537 538 539
        case ClipAttributes::ID_plane2Status:
            plane2Group->blockSignals(true);
            plane2Group->setChecked(atts->GetPlane2Status());
            plane2Group->blockSignals(false);
hrchilds's avatar
hrchilds committed
540
            break;
whitlocb's avatar
whitlocb committed
541 542 543 544
        case ClipAttributes::ID_plane3Status:
            plane3Group->blockSignals(true);
            plane3Group->setChecked(atts->GetPlane3Status());
            plane3Group->blockSignals(false);
hrchilds's avatar
hrchilds committed
545
            break;
whitlocb's avatar
whitlocb committed
546 547
        case ClipAttributes::ID_plane1Origin:
            plane1Group->SetOrigin(atts->GetPlane1Origin());
hrchilds's avatar
hrchilds committed
548
            break;
whitlocb's avatar
whitlocb committed
549 550
        case ClipAttributes::ID_plane2Origin:
            plane2Group->SetOrigin(atts->GetPlane2Origin());
hrchilds's avatar
hrchilds committed
551
            break;
whitlocb's avatar
whitlocb committed
552 553
        case ClipAttributes::ID_plane3Origin:
            plane3Group->SetOrigin(atts->GetPlane3Origin());
hrchilds's avatar
hrchilds committed
554
            break;
whitlocb's avatar
whitlocb committed
555 556
        case ClipAttributes::ID_plane1Normal:
            plane1Group->SetNormal(atts->GetPlane1Normal());
hrchilds's avatar
hrchilds committed
557
            break;
whitlocb's avatar
whitlocb committed
558 559
        case ClipAttributes::ID_plane2Normal:
            plane2Group->SetNormal(atts->GetPlane2Normal());
hrchilds's avatar
hrchilds committed
560
            break;
whitlocb's avatar
whitlocb committed
561 562
        case ClipAttributes::ID_plane3Normal:
            plane3Group->SetNormal(atts->GetPlane3Normal());
hrchilds's avatar
hrchilds committed
563
            break;
whitlocb's avatar
whitlocb committed
564
        case ClipAttributes::ID_planeInverse:
hrchilds's avatar
hrchilds committed
565
            planeInverse->blockSignals(true);
whitlocb's avatar
whitlocb committed
566
            planeInverse->setChecked(atts->GetPlaneInverse());
hrchilds's avatar
hrchilds committed
567
            planeInverse->blockSignals(false);
hrchilds's avatar
hrchilds committed
568
            break;
whitlocb's avatar
whitlocb committed
569
        case ClipAttributes::ID_planeToolControlledClipPlane:
570
            planeToolControlledClipPlane->blockSignals(true);
whitlocb's avatar
whitlocb committed
571 572
            planeToolControlledClipPlane->button(atts->GetPlaneToolControlledClipPlane())
                                                    ->setChecked(true);
573 574
            planeToolControlledClipPlane->blockSignals(false);
            break;
whitlocb's avatar
whitlocb committed
575 576
        case ClipAttributes::ID_center:
            centerLineEdit->setText(DoublesToQString(atts->GetCenter(),3));
hrchilds's avatar
hrchilds committed
577
            break;
whitlocb's avatar
whitlocb committed
578 579
        case ClipAttributes::ID_radius:
            radiusLineEdit->setText(DoubleToQString(atts->GetRadius()));
hrchilds's avatar
hrchilds committed
580
            break;
whitlocb's avatar
whitlocb committed
581
        case ClipAttributes::ID_sphereInverse:
hrchilds's avatar
hrchilds committed
582
            sphereInverse->blockSignals(true);
whitlocb's avatar
whitlocb committed
583
            sphereInverse->setChecked(atts->GetSphereInverse());
hrchilds's avatar
hrchilds committed
584
            sphereInverse->blockSignals(false);
hrchilds's avatar
hrchilds committed
585
            break;
whitlocb's avatar
whitlocb committed
586
        case ClipAttributes::ID_quality:
587
            qualityGroup->blockSignals(true);
whitlocb's avatar
whitlocb committed
588
            qualityGroup->button(atts->GetQuality())->setChecked(true);
589
            qualityGroup->blockSignals(false);
hrchilds's avatar
hrchilds committed
590
        }
hrchilds's avatar
hrchilds committed
591 592
    } // end for

hrchilds's avatar
hrchilds committed
593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617
}

// ****************************************************************************
// Method: QvisClipWindow::GetCurrentValues
//
// Purpose: 
//   Gets the current values for one or all of the lineEdit widgets.
//
// Arguments:
//   which_widget : The number of the widget to update. If -1 is passed,
//                  the routine gets the current values for all widgets.
//
// Programmer: Kathleen Bonnell
// Creation:   Mon Sep 25 15:11:42 PST 2000
//
// Modifications:
//   Jeremy Meredith, Fri Aug 17 13:45:27 PDT 2001
//   Fixed a possible free of memory we don't own.
//
//   Brad Whitlock, Fri Feb 15 11:54:50 PDT 2002
//   Fixed format strings.
//
//   Kathleen Bonnell, Tue May 20 16:02:52 PDT 2003  
//   Disallow (0, 0, 0) for a normal vector.
// 
whitlocb's avatar
whitlocb committed
618 619 620
//   Cyrus Harrison, Thu Aug 21 09:48:43 PDT 2008
//   Qt4 Port.
//
621 622 623
//   Hank Childs, Fri Jan  9 15:10:11 PST 2009
//   Fix typo in Qt4 port.
//
hrchilds's avatar
hrchilds committed
624 625 626 627 628
// ****************************************************************************

void
QvisClipWindow::GetCurrentValues(int which_widget)
{
629
    bool doAll = (which_widget == -1);
hrchilds's avatar
hrchilds committed
630

whitlocb's avatar
whitlocb committed
631 632
    // Do plane1Origin
    if(which_widget == ClipAttributes::ID_plane1Origin || doAll)
hrchilds's avatar
hrchilds committed
633
    {
whitlocb's avatar
whitlocb committed
634 635 636 637 638
        // get from planeGroupWidget
        double val[3];
        if(plane1Group->GetOrigin(val))
            atts->SetPlane1Origin(val);
        else
hrchilds's avatar
hrchilds committed
639
        {
whitlocb's avatar
whitlocb committed
640 641 642
            ResettingError(tr("Plane 1 Origin"),
                DoublesToQString(atts->GetPlane1Origin(),3));
            atts->SetPlane1Origin(atts->GetPlane1Origin());
hrchilds's avatar
hrchilds committed
643 644
        }
    }
whitlocb's avatar
whitlocb committed
645 646 647
    
    // Do plane2Origin
    if(which_widget == ClipAttributes::ID_plane2Origin || doAll)
hrchilds's avatar
hrchilds committed
648
    {
whitlocb's avatar
whitlocb committed
649 650 651
        // get from planeGroupWidget
        double val[3];
        if(plane2Group->GetOrigin(val))
652
            atts->SetPlane2Origin(val);
whitlocb's avatar
whitlocb committed
653
        else
hrchilds's avatar
hrchilds committed
654
        {
whitlocb's avatar
whitlocb committed
655 656 657
            ResettingError(tr("Plane 2 Origin"),
                DoublesToQString(atts->GetPlane2Origin(),3));
            atts->SetPlane2Origin(atts->GetPlane2Origin());
hrchilds's avatar
hrchilds committed
658 659 660
        }
    }

whitlocb's avatar
whitlocb committed
661 662
    // Do plane3Origin
    if(which_widget == ClipAttributes::ID_plane3Origin || doAll)
hrchilds's avatar
hrchilds committed
663
    {
whitlocb's avatar
whitlocb committed
664 665 666 667 668
        // get from planeGroupWidget
        double val[3];
        if(plane3Group->GetOrigin(val))
            atts->SetPlane3Origin(val);
        else
hrchilds's avatar
hrchilds committed
669
        {
whitlocb's avatar
whitlocb committed
670 671 672
            ResettingError(tr("Plane 3 Origin"),
                DoublesToQString(atts->GetPlane3Origin(),3));
            atts->SetPlane3Origin(atts->GetPlane3Origin());
hrchilds's avatar
hrchilds committed
673 674 675
        }
    }

whitlocb's avatar
whitlocb committed
676 677
    // Do plane1Normal
    if(which_widget == ClipAttributes::ID_plane1Normal || doAll)
hrchilds's avatar
hrchilds committed
678
    {
whitlocb's avatar
whitlocb committed
679 680 681 682 683
        // get from planeGroupWidget
        double val[3];
        if(plane1Group->GetNormal(val))
            atts->SetPlane1Normal(val);
        else
hrchilds's avatar
hrchilds committed
684
        {
whitlocb's avatar
whitlocb committed
685 686 687
            ResettingError(tr("Plane 1 Normal"),
                DoublesToQString(atts->GetPlane1Normal(),3));
            atts->SetPlane1Normal(atts->GetPlane1Normal());
hrchilds's avatar
hrchilds committed
688 689 690
        }
    }

whitlocb's avatar
whitlocb committed
691 692
    // Do plane2Normal
    if(which_widget == ClipAttributes::ID_plane2Normal || doAll)
hrchilds's avatar
hrchilds committed
693
    {
whitlocb's avatar
whitlocb committed
694 695 696 697 698
        // get from planeGroupWidget
        double val[3];
        if(plane2Group->GetNormal(val))
            atts->SetPlane2Normal(val);
        else
hrchilds's avatar
hrchilds committed
699
        {
whitlocb's avatar
whitlocb committed
700 701 702
            ResettingError(tr("Plane 2 Normal"),
                DoublesToQString(atts->GetPlane2Normal(),3));
            atts->SetPlane2Normal(atts->GetPlane2Normal());
hrchilds's avatar
hrchilds committed
703 704 705 706
        }

    }

whitlocb's avatar
whitlocb committed
707 708
    // Do plane3Normal
    if(which_widget == ClipAttributes::ID_plane3Normal || doAll)
hrchilds's avatar
hrchilds committed
709
    {
whitlocb's avatar
whitlocb committed
710 711 712 713 714
        // get from planeGroupWidget
        double val[3];
        if(plane3Group->GetNormal(val))
            atts->SetPlane3Normal(val);
        else
hrchilds's avatar
hrchilds committed
715
        {
whitlocb's avatar
whitlocb committed
716 717 718
            ResettingError(tr("Plane 3 Normal"),
                DoublesToQString(atts->GetPlane3Normal(),3));
            atts->SetPlane3Normal(atts->GetPlane3Normal());
hrchilds's avatar
hrchilds committed
719 720 721 722
        }

    }

723
    // Do center
whitlocb's avatar
whitlocb committed
724
    if(which_widget == ClipAttributes::ID_center || doAll)
hrchilds's avatar
hrchilds committed
725
    {
whitlocb's avatar
whitlocb committed
726 727 728 729
        double val[3];
        if(LineEditGetDoubles(centerLineEdit, val, 3))
            atts->SetCenter(val);
        else
hrchilds's avatar
hrchilds committed
730
        {
whitlocb's avatar
whitlocb committed
731 732 733
            ResettingError(tr("Center"),
                DoublesToQString(atts->GetCenter(),3));
            atts->SetCenter(atts->GetCenter());
hrchilds's avatar
hrchilds committed
734 735 736
        }
    }

whitlocb's avatar
whitlocb committed
737 738
    // Do radius
    if(which_widget == ClipAttributes::ID_radius || doAll)
hrchilds's avatar
hrchilds committed
739
    {
whitlocb's avatar
whitlocb committed
740 741 742 743
        double val;
        if(LineEditGetDouble(radiusLineEdit, val))
            atts->SetRadius(val);
        else
hrchilds's avatar
hrchilds committed
744
        {
whitlocb's avatar
whitlocb committed
745 746 747
            ResettingError(tr("Radius"),
                DoubleToQString(atts->GetRadius()));
            atts->SetRadius(atts->GetRadius());
hrchilds's avatar
hrchilds committed
748 749 750 751 752 753 754 755
        }
    }
}

//
// Qt Slot functions...
//

756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776
// ****************************************************************************
// Method: QvisClipWindow::qualityChanged
//
// Purpose:
//   This is a Qt slot function that is called when user selects a different 
//   clip quality.
//
// Arguments:
//   int : The currently active quality.
//
// Programmer: Sean Ahern
// Creation:   2 February 2008
//
// Modifications:
//
// ****************************************************************************

void
QvisClipWindow::qualityChanged(int quality)
{
    if (quality == 0)
whitlocb's avatar
whitlocb committed
777
        atts->SetQuality(ClipAttributes::Fast);
778
    else
whitlocb's avatar
whitlocb committed
779
        atts->SetQuality(ClipAttributes::Accurate);
780 781 782 783

    Apply();
}

hrchilds's avatar
hrchilds committed
784 785 786 787 788 789 790 791 792 793 794 795 796 797
// ****************************************************************************
// Method: QvisClipWindow::processPlane1Origin
//
// Purpose: 
//   This is a Qt slot function that sets an origin vector.
//
// Programmer: Kathleen Bonnell
// Creation:   May 7, 2001 
//
// Modifications:
//
//   Kathleen Bonnell, Tue Jun  5 15:11:09 PDT 2001
//   Changed 'apply' to 'Apply'.
//   
whitlocb's avatar
whitlocb committed
798 799 800
//   Cyrus Harrison, Thu Aug 21 09:48:43 PDT 2008
//   Qt4 Port.
//
hrchilds's avatar
hrchilds committed
801 802 803 804 805
// ****************************************************************************

void
QvisClipWindow::processPlane1Origin()
{
whitlocb's avatar
whitlocb committed
806
    GetCurrentValues(ClipAttributes::ID_plane1Origin);
hrchilds's avatar
hrchilds committed
807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824
    Apply();
}


// ****************************************************************************
// Method: QvisClipWindow::processPlane2Origin
//
// Purpose: 
//   This is a Qt slot function that sets an origin vector.
//
// Programmer: Kathleen Bonnell
// Creation:   May 7, 2001 
//
// Modifications:
//   
//   Kathleen Bonnell, Tue Jun  5 15:11:09 PDT 2001
//   Changed 'apply' to 'Apply'.
//   
whitlocb's avatar
whitlocb committed
825 826 827
//   Cyrus Harrison, Thu Aug 21 09:48:43 PDT 2008
//   Qt4 Port.
//
hrchilds's avatar
hrchilds committed
828 829 830 831 832
// ****************************************************************************

void
QvisClipWindow::processPlane2Origin()
{
whitlocb's avatar
whitlocb committed
833
    GetCurrentValues(ClipAttributes::ID_plane2Origin);
hrchilds's avatar
hrchilds committed
834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856
    Apply();
}


// ****************************************************************************
// Method: QvisClipWindow::processPlane3Origin
//
// Purpose: 
//   This is a Qt slot function that sets an origin vector.
//
// Programmer: Kathleen Bonnell
// Creation:   May 7, 2001 
//
// Modifications:
//   
//   Kathleen Bonnell, Tue Jun  5 15:11:09 PDT 2001
//   Changed 'apply' to 'Apply'.
//   
// ****************************************************************************

void
QvisClipWindow::processPlane3Origin()
{
whitlocb's avatar
whitlocb committed
857
    GetCurrentValues(ClipAttributes::ID_plane3Origin);
hrchilds's avatar
hrchilds committed
858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875
    Apply();
}


// ****************************************************************************
// Method: QvisClipWindow::processPlane1Normal
//
// Purpose: 
//   This is a Qt slot function that sets the normal vector.
//
// Programmer: Kathleen Bonnell
// Creation:   May 7, 2001 
//
// Modifications:
//   
//   Kathleen Bonnell, Tue Jun  5 15:11:09 PDT 2001
//   Changed 'apply' to 'Apply'.
//   
whitlocb's avatar
whitlocb committed
876 877 878
//   Cyrus Harrison, Thu Aug 21 09:48:43 PDT 2008
//   Qt4 Port.
//
hrchilds's avatar
hrchilds committed
879 880 881 882 883
// ****************************************************************************

void
QvisClipWindow::processPlane1Normal()
{
whitlocb's avatar
whitlocb committed
884
    GetCurrentValues(ClipAttributes::ID_plane1Normal);
hrchilds's avatar
hrchilds committed
885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901
    Apply();
}

// ****************************************************************************
// Method: QvisClipWindow::processPlane2Normal
//
// Purpose: 
//   This is a Qt slot function that sets the normal vector.
//
// Programmer: Kathleen Bonnell
// Creation:   May 7, 2001 
//
// Modifications:
//   
//   Kathleen Bonnell, Tue Jun  5 15:11:09 PDT 2001
//   Changed 'apply' to 'Apply'.
//   
whitlocb's avatar
whitlocb committed
902 903 904
//   Cyrus Harrison, Thu Aug 21 09:48:43 PDT 2008
//   Qt4 Port.
//
hrchilds's avatar
hrchilds committed
905 906 907 908 909
// ****************************************************************************

void
QvisClipWindow::processPlane2Normal()
{
whitlocb's avatar
whitlocb committed
910
    GetCurrentValues(ClipAttributes::ID_plane2Normal);
hrchilds's avatar
hrchilds committed
911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928
    Apply();
}


// ****************************************************************************
// Method: QvisClipWindow::processPlane3Normal
//
// Purpose: 
//   This is a Qt slot function that sets the normal vector.
//
// Programmer: Kathleen Bonnell
// Creation:   May 7, 2001 
//
// Modifications:
//   
//   Kathleen Bonnell, Tue Jun  5 15:11:09 PDT 2001
//   Changed 'apply' to 'Apply'.
//   
whitlocb's avatar
whitlocb committed
929 930 931
//   Cyrus Harrison, Thu Aug 21 09:48:43 PDT 2008
//   Qt4 Port.
//
hrchilds's avatar
hrchilds committed
932 933 934 935 936
// ****************************************************************************

void
QvisClipWindow::processPlane3Normal()
{
whitlocb's avatar
whitlocb committed
937
    GetCurrentValues(ClipAttributes::ID_plane3Normal);
hrchilds's avatar
hrchilds committed
938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954
    Apply();
}

// ****************************************************************************
// Method: QvisClipWindow::processCenterText
//
// Purpose: 
//   This is a Qt slot function that sets the center vector.
//
// Programmer: Kathleen Bonnell
// Creation:   May 7, 2001 
//
// Modifications:
//   
//   Kathleen Bonnell, Tue Jun  5 15:11:09 PDT 2001
//   Changed 'apply' to 'Apply'.
//   
whitlocb's avatar
whitlocb committed
955 956 957
//   Cyrus Harrison, Thu Aug 21 09:48:43 PDT 2008
//   Qt4 Port.
//
hrchilds's avatar
hrchilds committed
958 959 960 961 962
// ****************************************************************************

void
QvisClipWindow::processCenterText()
{
whitlocb's avatar
whitlocb committed
963
    GetCurrentValues(ClipAttributes::ID_center);
hrchilds's avatar
hrchilds committed
964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981
    Apply();
}


// ****************************************************************************
// Method: QvisClipWindow::processRadiusText
//
// Purpose: 
//   This is a Qt slot function that sets the upAxis vector.
//
// Programmer: Kathleen Bonnell
// Creation:   May 7, 2001 
//
// Modifications:
//   
//   Kathleen Bonnell, Tue Jun  5 15:11:09 PDT 2001
//   Changed 'apply' to 'Apply'.
//   
whitlocb's avatar
whitlocb committed
982 983 984
//   Cyrus Harrison, Thu Aug 21 09:48:43 PDT 2008
//   Qt4 Port.
//
hrchilds's avatar
hrchilds committed
985 986 987 988 989
// ****************************************************************************

void
QvisClipWindow::processRadiusText()
{
whitlocb's avatar
whitlocb committed
990
    GetCurrentValues(ClipAttributes::ID_radius);
hrchilds's avatar
hrchilds committed
991 992 993 994 995
    Apply();
}


// ****************************************************************************
996
// Method: QvisClipWindow::sliceTypeChanged
hrchilds's avatar
hrchilds committed
997 998 999
//
// Purpose:
//   This is a Qt slot function that is called when user selects a different 
1000
//   slice type.
hrchilds's avatar
hrchilds committed
1001 1002
//
// Arguments:
1003
//   int : The currently active slice type.
hrchilds's avatar
hrchilds committed
1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014
//
// Programmer: Kathleen Bonnell  
// Creation:   May 7, 2001 
//
// Modifications:
//   Kathleen Bonnell, Tue Jun  5 15:11:09 PDT 2001
//   Changed 'apply' to 'Apply'.
//   
//   Brad Whitlock, Thu Oct 31 11:53:01 PDT 2002
//   Changed to work with the updated state object.
//
1015 1016 1017 1018
//   Sean Ahern, Wed Feb 27 20:53:39 EST 2008
//   Removed the tabs, as it was an invalid way of using this visual
//   paradigm.
//
hrchilds's avatar
hrchilds committed
1019 1020 1021
// ****************************************************************************

void
1022
QvisClipWindow::sliceTypeChanged(int type)
hrchilds's avatar
hrchilds committed
1023
{
1024 1025
    if (type == 0)
    {
whitlocb's avatar
whitlocb committed
1026
        atts->SetFuncType(ClipAttributes::Plane);
1027 1028 1029
        sphereWidgets->hide();
        planeWidgets->show();
    }
hrchilds's avatar
hrchilds committed
1030
    else
1031
    {
whitlocb's avatar
whitlocb committed
1032
        atts->SetFuncType(ClipAttributes::Sphere);
1033 1034 1035 1036 1037 1038
        planeWidgets->hide();
        sphereWidgets->show();
    }

    QWidget *top = central->parentWidget();
    top->adjustSize();
hrchilds's avatar
hrchilds committed
1039 1040 1041 1042 1043 1044

    Apply();
}


// ****************************************************************************
hrchilds's avatar
hrchilds committed
1045
// Method: QvisClipWindow::plane1StatusToggled
hrchilds's avatar
hrchilds committed
1046 1047
//
// Purpose:
hrchilds's avatar
hrchilds committed
1048
//   This is a Qt slot function that is called when a status is changed.
hrchilds's avatar
hrchilds committed
1049 1050
//
// Arguments:
hrchilds's avatar
hrchilds committed
1051
//   val  :    The new state of the checkbox 
hrchilds's avatar
hrchilds committed
1052 1053 1054 1055 1056 1057 1058 1059 1060
//
// Programmer: Kathleen Bonnell
// Creation:   May 7, 2001
//
// Modifications:
//  
//   Kathleen Bonnell, Tue Jun  5 15:11:09 PDT 2001
//   Changed 'apply' to 'Apply'.
//   
hrchilds's avatar
hrchilds committed
1061 1062 1063
//   Kathleen Bonnell, Mon Dec  6 14:35:14 PST 2004 
//   Changed name from 'Clicked' to 'Toggled'. 
//
hrchilds's avatar
hrchilds committed
1064 1065 1066
// ****************************************************************************

void
hrchilds's avatar
hrchilds committed
1067
QvisClipWindow::plane1StatusToggled(bool val)
hrchilds's avatar
hrchilds committed
1068
{
whitlocb's avatar
whitlocb committed
1069
    atts->SetPlane1Status(val);
hrchilds's avatar
hrchilds committed
1070 1071 1072 1073
    Apply();
}

// ****************************************************************************
hrchilds's avatar
hrchilds committed
1074
// Method: QvisClipWindow::plane2StatusToggled
hrchilds's avatar
hrchilds committed
1075 1076
//
// Purpose:
hrchilds's avatar
hrchilds committed
1077
//   This is a Qt slot function that is called when a status is changed.
hrchilds's avatar
hrchilds committed
1078 1079
//
// Arguments:
hrchilds's avatar
hrchilds committed
1080
//   val  :    The new state of the checkbox. 
hrchilds's avatar
hrchilds committed
1081 1082 1083 1084 1085 1086 1087 1088 1089
//
// Programmer: Kathleen Bonnell
// Creation:   May 7, 2001
//
// Modifications:
//  
//   Kathleen Bonnell, Tue Jun  5 15:11:09 PDT 2001
//   Changed 'apply' to 'Apply'.
//   
hrchilds's avatar
hrchilds committed
1090 1091 1092
//   Kathleen Bonnell, Mon Dec  6 14:35:14 PST 2004 
//   Changed name from 'Clicked' to 'Toggled'. 
//
hrchilds's avatar
hrchilds committed
1093 1094 1095
// ****************************************************************************

void
hrchilds's avatar
hrchilds committed
1096
QvisClipWindow::plane2StatusToggled(bool val)
hrchilds's avatar
hrchilds committed
1097
{
whitlocb's avatar
whitlocb committed
1098
    atts->SetPlane2Status(val);
hrchilds's avatar
hrchilds committed
1099 1100 1101 1102 1103
    Apply();
}


// ****************************************************************************
hrchilds's avatar
hrchilds committed
1104
// Method: QvisClipWindow::plane3StatusToggled
hrchilds's avatar
hrchilds committed
1105 1106
//
// Purpose:
hrchilds's avatar
hrchilds committed
1107
//   This is a Qt slot function that is called when a status is changed.
hrchilds's avatar
hrchilds committed
1108 1109
//
// Arguments:
hrchilds's avatar
hrchilds committed
1110
//   val  :    The new state of the checkbox.
hrchilds's avatar
hrchilds committed
1111 1112 1113 1114 1115 1116 1117 1118 1119
//
// Programmer: Kathleen Bonnell
// Creation:   May 7, 2001
//
// Modifications:
//  
//   Kathleen Bonnell, Tue Jun  5 15:11:09 PDT 2001
//   Changed 'apply' to 'Apply'.
//   
hrchilds's avatar
hrchilds committed
1120 1121 1122
//   Kathleen Bonnell, Mon Dec  6 14:35:14 PST 2004 
//   Changed name from 'Clicked' to 'Toggled'. 
//
hrchilds's avatar
hrchilds committed
1123 1124 1125
// ****************************************************************************

void
hrchilds's avatar
hrchilds committed
1126
QvisClipWindow::plane3StatusToggled(bool val)
hrchilds's avatar
hrchilds committed
1127
{
whitlocb's avatar
whitlocb committed
1128
    atts->SetPlane3Status(val);
hrchilds's avatar
hrchilds committed
1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155
    Apply();
}


// ****************************************************************************
// Method: QvisClipWindow::planeInverseToggled
//
// Purpose:
//   This is a Qt slot function that is called when the plane inverse
//   button is toggled.
//
// Arguments:
//   val  :  On/off.
//
// Programmer: Kathleen Bonnell
// Creation:   May 7, 2001
//
// Modifications:
//  
//   Kathleen Bonnell, Tue Jun  5 15:11:09 PDT 2001
//   Changed 'apply' to 'Apply'.
//   
// ****************************************************************************

void
QvisClipWindow::planeInverseToggled(bool val)
{
whitlocb's avatar
whitlocb committed
1156
    atts->SetPlaneInverse(val);
hrchilds's avatar
hrchilds committed
1157 1158 1159 1160
    Apply();
}


1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180
// ****************************************************************************
// Method: QvisClipWindow::planeToolControlledClipPlaneChanged
//
// Purpose:
//   This is a Qt slot function that is called when another radio button in the
//   planeToolControlledClipPlane button group is selected.
//
// Arguments:
//   val  :  Which button is now active.
//
// Programmer: Gunther H. Weber
// Creation:   August 14, 2007
//
// Modifications:
//   
// ****************************************************************************

void
QvisClipWindow::planeToolControlledClipPlaneChanged(int val)
{
whitlocb's avatar
whitlocb committed
1181
    if(val != atts->GetPlaneToolControlledClipPlane())
1182
    {
whitlocb's avatar
whitlocb committed
1183
        atts->SetPlaneToolControlledClipPlane(ClipAttributes::WhichClipPlane(val));
1184 1185 1186 1187 1188 1189
        SetUpdate(false);
        Apply();
    }
}


hrchilds's avatar
hrchilds committed
1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212
// ****************************************************************************
// Method: QvisClipWindow::sphereInverseToggled
//
// Purpose:
//   This is a Qt slot function that is called when the sphere inverse
//   button is toggled.
//
// Arguments:
//   val  :  On/off. 
//
// Programmer: Kathleen Bonnell
// Creation:   May 7, 2001
//
// Modifications:
//  
//   Kathleen Bonnell, Tue Jun  5 15:11:09 PDT 2001
//   Changed 'apply' to 'Apply'.
//   
// ****************************************************************************

void
QvisClipWindow::sphereInverseToggled(bool val)
{
whitlocb's avatar
whitlocb committed
1213
    atts->SetSphereInverse(val);
hrchilds's avatar
hrchilds committed
1214 1215
    Apply();
}