QvisAnnotationWindow.C 119 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
#include <stdio.h>
#include <QvisAnnotationWindow.h>
whitlocb's avatar
whitlocb committed
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
#include <QButtonGroup>
#include <QCheckBox>
#include <QComboBox>
#include <QGroupBox>
#include <QInputDialog>
#include <QLabel>
#include <QLayout>
#include <QListWidget>
#include <QPushButton>
#include <QRadioButton>
#include <QSpinBox>
#include <QTabWidget>
#include <QTimer>
#include <QToolTip>
#include <QWidget>
hrchilds's avatar
hrchilds committed
56 57 58 59

#include <QNarrowLineEdit.h>
#include <QvisAnnotationObjectInterface.h>
#include <QvisAnnotationObjectInterfaceFactory.h>
whitlocb's avatar
whitlocb committed
60
#include <QvisAxisAttributesWidget.h>
hrchilds's avatar
hrchilds committed
61
#include <QvisColorButton.h>
62
#include <QvisDialogLineEdit.h>
whitlocb's avatar
whitlocb committed
63
#include <QvisFontAttributesWidget.h>
hrchilds's avatar
hrchilds committed
64 65 66 67
#include <QvisLineWidthWidget.h>
#include <AnnotationAttributes.h>
#include <AnnotationObject.h>
#include <AnnotationObjectList.h>
hrchilds's avatar
hrchilds committed
68
#include <PlotList.h>
hrchilds's avatar
hrchilds committed
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
#include <DataNode.h>
#include <ViewerProxy.h>

#include <DebugStream.h>

// ****************************************************************************
// Method: QvisAnnotationWindow::QvisAnnotationWindow
//
// Purpose: 
//   This is the constructor for the QvisAnnotationWindow class.
//
// Arguments:
//   subj    : The AnnotationAttributes object that the window observes.
//   caption : The string that appears in the window decorations.
//
// Programmer: Brad Whitlock
// Creation:   Sun Jun 17 23:45:35 PST 2001
//
// Modifications:
//   Brad Whitlock, Mon Aug 27 17:15:18 PST 2001
//   Initialized the active tab.
//
//   Brad Whitlock, Fri Feb 15 15:34:46 PST 2002
//   Initialized parentless widgets.
//
//   Eric Brugger, Mon Nov  4 12:21:02 PST 2002
//   Added more control over the axes tick marks and labels.
//
//   Brad Whitlock, Thu Oct 30 17:40:39 PST 2003
//   Changed it to a QvisPostableWindowSimpleObserver and added objButtonGroup.
//
hrchilds's avatar
hrchilds committed
100 101 102
//   Brad Whitlock, Wed Mar 21 21:08:54 PST 2007
//   Made it observe the plot list.
//
whitlocb's avatar
whitlocb committed
103 104 105
//   Brad Whitlock, Thu Feb 7 16:32:02 PST 2008
//   Removed some widgets.
//
106 107 108
//   Brad Whitlock, Wed Apr  9 10:59:06 PDT 2008
//   QString for caption, shortName.
//
hrchilds's avatar
hrchilds committed
109 110
// ****************************************************************************

111 112
QvisAnnotationWindow::QvisAnnotationWindow(const QString &caption,
    const QString &shortName, QvisNotepadArea *notepad) :
hrchilds's avatar
hrchilds committed
113 114 115 116 117 118
    QvisPostableWindowSimpleObserver(caption, shortName, notepad,
    QvisPostableWindowSimpleObserver::AllExtraButtons, false)
{
    // Initialize the subject pointers.
    annotationAtts = 0;
    annotationObjectList = 0;
hrchilds's avatar
hrchilds committed
119
    plotList = 0;
hrchilds's avatar
hrchilds committed
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

    objectInterfaces = 0;
    nObjectInterfaces = 0;
    displayInterface = 0;

    activeTab = 0;

    // Initialize parentless widgets.
    backgroundStyleButtons = 0;

    objButtonGroup = 0;
}

// ****************************************************************************
// Method: QvisAnnotationWindow::~QvisAnnotationWindow
//
// Purpose: 
//   This is the destructor for the QvisAnnotationWindow class.
//
// Programmer: Brad Whitlock
// Creation:   Sun Jun 17 23:46:30 PST 2001
//
// Modifications:
//   Brad Whitlock, Fri Feb 15 15:34:19 PST 2002
//   Deleted parentless widgets.
//   
//   Eric Brugger, Mon Nov  4 12:21:02 PST 2002
//   Added more control over the axes tick marks and labels.
//
//   Brad Whitlock, Thu Oct 30 16:49:20 PST 2003
//   Added detachment of subjects and deletion of objButtonGroup.
//
hrchilds's avatar
hrchilds committed
152 153 154
//   Brad Whitlock, Wed Mar 21 21:09:21 PST 2007
//   Detach plot list.
//
whitlocb's avatar
whitlocb committed
155 156 157
//   Brad Whitlock, Thu Feb 7 16:32:19 PST 2008
//   Removed some widgets.
//
hrchilds's avatar
hrchilds committed
158 159 160 161 162 163 164 165 166 167
// ****************************************************************************

QvisAnnotationWindow::~QvisAnnotationWindow()
{
    if(annotationAtts)
        annotationAtts->Detach(this);

    if(annotationObjectList)
        annotationObjectList->Detach(this);

hrchilds's avatar
hrchilds committed
168 169 170
    if(plotList)
        plotList->Detach(this);

hrchilds's avatar
hrchilds committed
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 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213
    delete [] objectInterfaces;
}

// ****************************************************************************
// Method: QvisAnnotationWindow::ConnectAnnotationAttributes
//
// Purpose: 
//   Makes the window observe the annotation attributes.
//
// Programmer: Brad Whitlock
// Creation:   Fri Oct 31 14:29:36 PST 2003
//
// Modifications:
//   
// ****************************************************************************

void
QvisAnnotationWindow::ConnectAnnotationAttributes(AnnotationAttributes *a)
{
    annotationAtts = a;
    a->Attach(this);
}

// ****************************************************************************
// Method: QvisAnnotationWindow::ConnectAnnotationObjectList.
//
// Purpose: 
//   Makes the window observe the annotation object list.
//
// Programmer: Brad Whitlock
// Creation:   Fri Oct 31 14:29:36 PST 2003
//
// Modifications:
//   
// ****************************************************************************

void
QvisAnnotationWindow::ConnectAnnotationObjectList(AnnotationObjectList *a)
{
    annotationObjectList = a;
    a->Attach(this);
}

hrchilds's avatar
hrchilds committed
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
// ****************************************************************************
// Method: QvisAnnotationWindow::ConnectPlotList
//
// Purpose: 
//   Makes the window observe the plot list.
//
// Programmer: Brad Whitlock
// Creation:   Wed Mar 21 21:09:45 PST 2007
//
// Modifications:
//   
// ****************************************************************************

void
QvisAnnotationWindow::ConnectPlotList(PlotList *pl)
{
    plotList = pl;
    pl->Attach(this);
}

hrchilds's avatar
hrchilds committed
234 235 236 237 238 239 240 241 242 243 244 245 246
// ****************************************************************************
// Method: QvisAnnotationWindow::SubjectRemoved
//
// Purpose: 
//   This method disconnects a subject from the window.
//
// Arguments:
//   TheRemovedSubject : The subject to detach.
//
// Programmer: Brad Whitlock
// Creation:   Tue Dec 2 15:16:47 PST 2003
//
// Modifications:
hrchilds's avatar
hrchilds committed
247 248 249
//   Brad Whitlock, Wed Mar 21 21:10:32 PST 2007
//   Added the plot list.
//
hrchilds's avatar
hrchilds committed
250 251 252 253 254 255 256 257 258 259
// ****************************************************************************

void
QvisAnnotationWindow::SubjectRemoved(Subject *TheRemovedSubject)
{
    if(TheRemovedSubject == annotationAtts)
        annotationAtts = 0;

    if(TheRemovedSubject == annotationObjectList)
        annotationObjectList = 0;
hrchilds's avatar
hrchilds committed
260 261 262

    if(TheRemovedSubject == plotList)
        plotList = 0;
hrchilds's avatar
hrchilds committed
263 264 265 266 267 268 269 270 271 272 273 274 275 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
}

// ****************************************************************************
// Method: QvisAnnotationWindow::CreateWindowContents
//
// Purpose: 
//   This method creates all of the widgets for the window.
//
// Programmer: Brad Whitlock
// Creation:   Sun Jun 17 23:46:53 PST 2001
//
// Modifications:
//   Kathleen Bonnell, Fri Jul  6 14:48:53 PDT 2001
//   Enable gridlines for 2D.
//
//   Brad Whitlock, Mon Aug 27 14:37:28 PST 2001
//   Added color buttons to control the background and foreground colors.
//
//   Kathleen Bonnell, Fri Aug  3 15:04:32 PDT 2001 
//   Enable gridlines for 3D.  Added static edges to 3d axes-type options.
//
//   Brad Whitlock, Fri Sep 21 15:53:34 PST 2001
//   Changed the code so the triad and bbox toggles are not part of the
//   page3d groupbox.
//
//   Kathleen Bonnell, Wed Nov  7 17:45:20 PST 2001
//   Added another option to axes3DTypeComboBox. 
//
//   Brad Whitlock, Wed Sep 19 15:40:50 PST 2001
//   I removed an unused layout.
//
//   Brad Whitlock, Thu Jan 10 08:34:41 PDT 2002
//   I added a checkbox to toggle the visibility of the user information.
//
//   Brad Whitlock, Thu Apr 11 11:43:49 PDT 2002
//   I added checkboxes for the legend and the database.
//
//   Eric Brugger, Mon Nov  4 12:21:02 PST 2002
//   Added more control over the axes tick marks and labels.
//
//   Eric Brugger, Tue Jun 24 16:04:01 PDT 2003
//   Added the ability to control the 2d axes line width and replaced the
//   2d font size setting with individual controls for setting the x label,
//   y label, x title, and y title font heights.
//
//   Brad Whitlock, Mon Nov 10 16:28:36 PST 2003
//   I added a button that can turn off all annotations.
//
//   Brad Whitlock, Thu Oct 30 16:36:49 PST 2003
//   I moved the code that creates the tabbed controls to different methods.
//
314 315 316
//   Cyrus Harrison, Mon Jun 18 08:57:46 PDT 2007
//   Added database info path expansion mode label and combo box.
//
317 318 319
//   Cyrus Harrison, Tue Sep 25 10:44:04 PDT 2007
//   Moved general options to a new tab
//
whitlocb's avatar
whitlocb committed
320 321 322
//   Brad Whitlock, Wed Jun 25 09:30:20 PDT 2008
//   Qt 4.
//
323 324 325
//   Jeremy Meredith, Tue Nov 18 15:45:15 EST 2008
//   Added options for AxisArray modality.
//
hrchilds's avatar
hrchilds committed
326 327 328 329 330
// ****************************************************************************

void
QvisAnnotationWindow::CreateWindowContents()
{
331
    // Create the tab widget.
whitlocb's avatar
whitlocb committed
332
    tabs = new QTabWidget(central);
333 334
    connect(tabs, SIGNAL(currentChanged(int)),
            this, SLOT(tabSelected(int)));
335 336 337 338 339 340 341 342 343

    topLayout->addWidget(tabs);    

    //
    // Create the window's tabs.
    ///
    CreateGeneralTab();
    Create2DTab();
    Create3DTab();
344
    CreateArrayTab();
345 346 347 348 349
    CreateColorTab();
    CreateObjectsTab();

    // Show the appropriate page based on the activeTab setting.
    tabs->blockSignals(true);
whitlocb's avatar
whitlocb committed
350
    tabs->setCurrentIndex(activeTab);
351 352 353 354 355 356 357 358 359 360 361 362 363 364 365
    tabs->blockSignals(false);
}


// ****************************************************************************
// Method: QvisAnnotationWindow::CreateGeneralTab
//
// Purpose: 
//   Creates the general options tab.
//
// Note:       I moved this code from CreateWindowContents.
//
// Programmer: Cyrus Harrison
// Creation:   Tue Oct  2 09:29:53 PDT 2007
//
366 367 368 369
// Modifications:
//   Brad Whitlock, Tue Apr  8 09:27:26 PDT 2008
//   Support for internationalization.
//
whitlocb's avatar
whitlocb committed
370 371 372
//   Brad Whitlock, Wed Jun 25 09:30:38 PDT 2008
//   Qt 4.
//
373 374 375
//   Kathleen Biagas, Wed Sep  7 16:16:36 PDT 2011
//   Add timeInfo.
//
376
// ****************************************************************************
hrchilds's avatar
hrchilds committed
377

378 379 380 381 382 383
void
QvisAnnotationWindow::CreateGeneralTab()
{
    //
    // Create the group of widgets that control general annotation options
    //
whitlocb's avatar
whitlocb committed
384
    pageGeneral = new QWidget(central);
385
    tabs->addTab(pageGeneral, tr("General"));
386 387

    // use two layouts, so we can have a compact look
whitlocb's avatar
whitlocb committed
388 389 390 391 392 393
    QVBoxLayout *glayout = new QVBoxLayout(pageGeneral);
    glayout->setMargin(5);
    QHBoxLayout *hlayout = new QHBoxLayout(0);
    hlayout->setSpacing(5);
    glayout->addLayout(hlayout);
    glayout->addStretch(10);
394

whitlocb's avatar
whitlocb committed
395
    // Create a toggle for the legend.
whitlocb's avatar
whitlocb committed
396
    legendInfo = new QCheckBox(tr("Legend"), pageGeneral);
whitlocb's avatar
whitlocb committed
397 398
    connect(legendInfo, SIGNAL(toggled(bool)),
            this, SLOT(legendChecked(bool)));
whitlocb's avatar
whitlocb committed
399
    hlayout->addWidget(legendInfo);
400

whitlocb's avatar
whitlocb committed
401
    // Create a button that can turn off all annotations.
whitlocb's avatar
whitlocb committed
402
    turnOffAllButton = new QPushButton(tr("No annotations"), pageGeneral);
whitlocb's avatar
whitlocb committed
403 404
    connect(turnOffAllButton, SIGNAL(clicked()),
            this, SLOT(turnOffAllAnnotations()));
whitlocb's avatar
whitlocb committed
405
    hlayout->addWidget(turnOffAllButton);
406

whitlocb's avatar
whitlocb committed
407 408 409
    //
    // Create the database information
    //
whitlocb's avatar
whitlocb committed
410
    databaseInfo = new QGroupBox(pageGeneral);
411
    databaseInfo->setTitle(tr("Database"));
whitlocb's avatar
whitlocb committed
412 413 414
    databaseInfo->setCheckable(true);
    connect(databaseInfo, SIGNAL(toggled(bool)),
            this, SLOT(databaseInfoChecked(bool)));
whitlocb's avatar
whitlocb committed
415 416 417 418 419 420 421 422 423 424 425
    glayout->addWidget(databaseInfo);
    QGridLayout *dLayout = new QGridLayout(databaseInfo);
    dLayout->setSpacing(10);
    dLayout->setColumnStretch(1, 10);

    databasePathExpansionMode = new QComboBox(databaseInfo);
    databasePathExpansionMode->addItem(tr("File"));
    databasePathExpansionMode->addItem(tr("Directory"));
    databasePathExpansionMode->addItem(tr("Full"));
    databasePathExpansionMode->addItem(tr("Smart"));
    databasePathExpansionMode->addItem(tr("Smart Directory"));
426

427 428
    connect(databasePathExpansionMode, SIGNAL(activated(int)),
            this, SLOT(databasePathExpansionModeChanged(int)));
whitlocb's avatar
whitlocb committed
429 430 431
    databasePathExpansionModeLabel = new QLabel(tr("Path Expansion"), 
        databaseInfo);
    databasePathExpansionModeLabel->setBuddy(databasePathExpansionMode);
whitlocb's avatar
whitlocb committed
432 433
    dLayout->addWidget(databasePathExpansionModeLabel, 0, 0);
    dLayout->addWidget(databasePathExpansionMode, 0, 1);
434

whitlocb's avatar
whitlocb committed
435
    QFrame *dbSep = new QFrame(databaseInfo);
whitlocb's avatar
whitlocb committed
436
    dbSep->setFrameStyle(QFrame::HLine + QFrame::Sunken);
whitlocb's avatar
whitlocb committed
437
    dLayout->addWidget(dbSep, 1, 0, 1, 2);
438

whitlocb's avatar
whitlocb committed
439
    databaseInfoFont = new QvisFontAttributesWidget(databaseInfo);
whitlocb's avatar
whitlocb committed
440 441
    connect(databaseInfoFont, SIGNAL(fontChanged(const FontAttributes &)),
            this, SLOT(databaseInfoFontChanged(const FontAttributes &)));
whitlocb's avatar
whitlocb committed
442
    dLayout->addWidget(databaseInfoFont, 2, 0, 1, 2);
hrchilds's avatar
hrchilds committed
443

444 445 446 447
    QFrame *dbSep2 = new QFrame(databaseInfo);
    dbSep2->setFrameStyle(QFrame::HLine + QFrame::Sunken);
    dLayout->addWidget(dbSep2, 3, 0, 1, 2);

448 449 450 451 452 453 454
    timeInfo = new QGroupBox(databaseInfo);
    timeInfo->setTitle(tr("Time"));
    timeInfo->setCheckable(true);
    connect(timeInfo, SIGNAL(toggled(bool)), this, SLOT(timeInfoChecked(bool)));
    dLayout->addWidget(timeInfo, 4, 0, 1, 2);

    QHBoxLayout *htLayout = new QHBoxLayout(timeInfo);
455
    htLayout->setSpacing(5);
456
    databaseTimeScale = new QNarrowLineEdit(timeInfo);
457 458
    connect(databaseTimeScale, SIGNAL(returnPressed()),
            this, SLOT(databaseTimeScaleChanged()));
459
    htLayout->addWidget(new QLabel(tr("Time scale factor"), timeInfo));
460 461
    htLayout->addWidget(databaseTimeScale);

462
    databaseTimeOffset = new QNarrowLineEdit(timeInfo);
463 464
    connect(databaseTimeOffset, SIGNAL(returnPressed()),
            this, SLOT(databaseTimeOffsetChanged()));
465
    htLayout->addWidget(new QLabel(tr("Time offset"), timeInfo));
466 467
    htLayout->addWidget(databaseTimeOffset);

whitlocb's avatar
whitlocb committed
468 469 470
    //
    // Create the user information
    //
whitlocb's avatar
whitlocb committed
471
    userInfo = new QGroupBox(pageGeneral);
472
    userInfo->setTitle(tr("User information"));
whitlocb's avatar
whitlocb committed
473 474 475
    userInfo->setCheckable(true);
    connect(userInfo, SIGNAL(toggled(bool)),
            this, SLOT(userInfoChecked(bool)));
whitlocb's avatar
whitlocb committed
476 477
    glayout->addWidget(userInfo);
    QVBoxLayout *uLayout = new QVBoxLayout(userInfo);
whitlocb's avatar
whitlocb committed
478
    uLayout->setSpacing(5);
whitlocb's avatar
whitlocb committed
479
    userInfoFont = new QvisFontAttributesWidget(userInfo);
whitlocb's avatar
whitlocb committed
480 481
    connect(userInfoFont, SIGNAL(fontChanged(const FontAttributes &)),
            this, SLOT(userInfoFontChanged(const FontAttributes &)));
whitlocb's avatar
whitlocb committed
482 483 484
    uLayout->addWidget(userInfoFont);

    glayout->addStretch(100);
hrchilds's avatar
hrchilds committed
485 486
}

487

hrchilds's avatar
hrchilds committed
488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505
// ****************************************************************************
// Method: QvisAnnotationWindow::Create2DTab
//
// Purpose: 
//   Creates the 2D options tab.
//
// Note:       I moved this code from CreateWindowContents.
//
// Programmer: Brad Whitlock
// Creation:   Thu Oct 30 16:35:59 PST 2003
//
// Modifications:
//   Kathleen Bonnell, Tue Dec 16 11:34:33 PST 2003
//   Added button for automatic label scaling, text fields for label exponents.
//
//   Brad Whitlock, Wed Jul 27 16:01:31 PST 2005
//   I made it create a "Grid and Ticks" tab and a "Title and Labels" tab.
//
whitlocb's avatar
whitlocb committed
506 507 508 509
//   Brad Whitlock, Thu Feb 7 17:01:36 PST 2008
//   I changed the method so it creates "General 2D", "X-Axis", and "Y-Axis"
//   tabs instead of the previous organization.
//
510 511 512
//   Brad Whitlock, Tue Apr  8 09:27:26 PDT 2008
//   Support for internationalization.
//
whitlocb's avatar
whitlocb committed
513 514 515
//   Brad Whitlock, Wed Jun 25 09:48:41 PDT 2008
//   Qt 4.
//
516 517 518 519 520
//   Jeremy Meredith, Thu Jan 22 14:53:22 EST 2009
//   Update just the various 2D sub-tabs sensitivity, not the entire
//   2D tab, when "show axes" is unchecked.  (If you set the whole
//   tab, then you've even disabled "show axes" and can't re-check it.)
//
hrchilds's avatar
hrchilds committed
521 522 523 524 525 526 527 528
// ****************************************************************************

void
QvisAnnotationWindow::Create2DTab()
{
    //
    // Create the group of 2D-related widgets and add them as a tab.
    //
whitlocb's avatar
whitlocb committed
529 530 531 532
    page2D = new QWidget(central);
    QVBoxLayout *page2DLayout = new QVBoxLayout(page2D);
    page2DLayout->setSpacing(5);
    page2DLayout->setMargin(10);
533
    tabs->addTab(page2D, tr("2D"));
hrchilds's avatar
hrchilds committed
534

whitlocb's avatar
whitlocb committed
535
    axesFlagToggle2D = new QCheckBox(tr("Show axes"), page2D);
hrchilds's avatar
hrchilds committed
536 537
    connect(axesFlagToggle2D, SIGNAL(toggled(bool)),
            this, SLOT(axesFlagChecked2D(bool)));
whitlocb's avatar
whitlocb committed
538
    page2DLayout->addWidget(axesFlagToggle2D);
hrchilds's avatar
hrchilds committed
539

540
    page2DTabs = new QTabWidget(page2D);
whitlocb's avatar
whitlocb committed
541
    page2DLayout->addWidget(page2DTabs);
hrchilds's avatar
hrchilds committed
542

whitlocb's avatar
whitlocb committed
543
    // Create the general options page.
544
    page2DTabs->addTab(CreateGeneralTab2D(page2DTabs), tr("General 2D"));
whitlocb's avatar
whitlocb committed
545 546

    // Add the X-axis page.
whitlocb's avatar
whitlocb committed
547
    axes2D[0] = new QvisAxisAttributesWidget(page2DTabs, false);
whitlocb's avatar
whitlocb committed
548 549
    connect(axes2D[0], SIGNAL(axisChanged(const AxisAttributes &)),
            this, SLOT(xAxisChanged2D(const AxisAttributes &)));
550
    page2DTabs->addTab(axes2D[0], tr("X-Axis"));
whitlocb's avatar
whitlocb committed
551 552

    // Add the Y-axis page.
whitlocb's avatar
whitlocb committed
553
    axes2D[1] = new QvisAxisAttributesWidget(page2DTabs, false);
whitlocb's avatar
whitlocb committed
554 555
    connect(axes2D[1], SIGNAL(axisChanged(const AxisAttributes &)),
            this, SLOT(yAxisChanged2D(const AxisAttributes &)));
556
    page2DTabs->addTab(axes2D[1], tr("Y-Axis"));
hrchilds's avatar
hrchilds committed
557 558 559
}

// ****************************************************************************
whitlocb's avatar
whitlocb committed
560
// Method: QvisAnnotationWindow::CreateGeneralTab2D
hrchilds's avatar
hrchilds committed
561 562
//
// Purpose: 
whitlocb's avatar
whitlocb committed
563
//   Creates the options for the general 2D tab.
hrchilds's avatar
hrchilds committed
564 565
//
// Arguments:
whitlocb's avatar
whitlocb committed
566
//   parentWidget : The parent of the widgets we'll create.
hrchilds's avatar
hrchilds committed
567
//
whitlocb's avatar
whitlocb committed
568
// Returns:    
hrchilds's avatar
hrchilds committed
569 570 571 572
//
// Note:       
//
// Programmer: Brad Whitlock
whitlocb's avatar
whitlocb committed
573
// Creation:   Thu Feb 7 16:45:23 PST 2008
hrchilds's avatar
hrchilds committed
574 575
//
// Modifications:
576 577
//   Brad Whitlock, Tue Apr  8 09:27:26 PDT 2008
//   Support for internationalization.
whitlocb's avatar
whitlocb committed
578 579 580 581
//
//   Brad Whitlock, Thu Jun 26 10:03:31 PDT 2008
//   Qt 4.
//
hrchilds's avatar
hrchilds committed
582 583 584
// ****************************************************************************

QWidget *
whitlocb's avatar
whitlocb committed
585
QvisAnnotationWindow::CreateGeneralTab2D(QWidget *parentWidget)
hrchilds's avatar
hrchilds committed
586
{
whitlocb's avatar
whitlocb committed
587 588 589 590 591 592
    QWidget *top = new QWidget(parentWidget);
    QVBoxLayout *vlayout = new QVBoxLayout(top);
    vlayout->setMargin(10);
    QGridLayout *lLayout = new QGridLayout(0);
    vlayout->addLayout(lLayout);
    vlayout->addStretch(100);
hrchilds's avatar
hrchilds committed
593
    lLayout->setSpacing(5);
whitlocb's avatar
whitlocb committed
594 595
    lLayout->setMargin(0);
    lLayout->setColumnStretch(1, 10);
whitlocb's avatar
whitlocb committed
596 597 598

    // Create auto set scaling check box.
    int row = 0;
599
    labelAutoSetScalingToggle2D = new QCheckBox(tr("Auto scale label values"),
whitlocb's avatar
whitlocb committed
600
        top);
whitlocb's avatar
whitlocb committed
601 602
    connect(labelAutoSetScalingToggle2D, SIGNAL(toggled(bool)),
            this, SLOT(labelAutoSetScalingChecked2D(bool)));
whitlocb's avatar
whitlocb committed
603
    lLayout->addWidget(labelAutoSetScalingToggle2D, row, 0, 1, 2);
whitlocb's avatar
whitlocb committed
604
    ++row;
hrchilds's avatar
hrchilds committed
605

whitlocb's avatar
whitlocb committed
606
    // Create auto set ticks check box.
whitlocb's avatar
whitlocb committed
607
    axesAutoSetTicksToggle2D = new QCheckBox(tr("Auto set ticks"), top);
hrchilds's avatar
hrchilds committed
608 609
    connect(axesAutoSetTicksToggle2D, SIGNAL(toggled(bool)),
            this, SLOT(axesAutoSetTicksChecked2D(bool)));
whitlocb's avatar
whitlocb committed
610
    lLayout->addWidget(axesAutoSetTicksToggle2D, row, 0, 1, 2);
whitlocb's avatar
whitlocb committed
611
    ++row;
hrchilds's avatar
hrchilds committed
612 613

    // Create the 2D tick mark locations combobox.
whitlocb's avatar
whitlocb committed
614 615 616 617
    axesTickLocationComboBox2D = new QComboBox(top);
    axesTickLocationComboBox2D->addItem(tr("Inside"));
    axesTickLocationComboBox2D->addItem(tr("Outside"));
    axesTickLocationComboBox2D->addItem(tr("Both"));
hrchilds's avatar
hrchilds committed
618 619
    connect(axesTickLocationComboBox2D, SIGNAL(activated(int)),
            this, SLOT(axesTickLocationChanged2D(int)));
whitlocb's avatar
whitlocb committed
620
    lLayout->addWidget(axesTickLocationComboBox2D, row, 1);
whitlocb's avatar
whitlocb committed
621 622
    QLabel *l = new QLabel(tr("Tick mark locations"), top);
    l->setBuddy(axesTickLocationComboBox2D);
whitlocb's avatar
whitlocb committed
623 624
    lLayout->addWidget(l, row, 0);
    ++row;
hrchilds's avatar
hrchilds committed
625 626

    // Create the 2D tick marks combobox.
whitlocb's avatar
whitlocb committed
627 628 629 630 631 632
    axesTicksComboBox2D = new QComboBox(top);
    axesTicksComboBox2D->addItem(tr("Off"));
    axesTicksComboBox2D->addItem(tr("Bottom"));
    axesTicksComboBox2D->addItem(tr("Left"));
    axesTicksComboBox2D->addItem(tr("Bottom-left"));
    axesTicksComboBox2D->addItem(tr("All axes"));
hrchilds's avatar
hrchilds committed
633 634
    connect(axesTicksComboBox2D, SIGNAL(activated(int)),
            this, SLOT(axesTicksChanged2D(int)));
whitlocb's avatar
whitlocb committed
635
    lLayout->addWidget(axesTicksComboBox2D, row, 1);
whitlocb's avatar
whitlocb committed
636 637
    l = new QLabel("Show tick marks", top);
    l->setBuddy(axesTicksComboBox2D);
whitlocb's avatar
whitlocb committed
638 639
    lLayout->addWidget(l, row, 0);
    ++row;
hrchilds's avatar
hrchilds committed
640 641

    // Create the 2D line width widget.
whitlocb's avatar
whitlocb committed
642
    axesLineWidth2D = new QvisLineWidthWidget(0, top);
whitlocb's avatar
whitlocb committed
643
    lLayout->addWidget(axesLineWidth2D, row, 1);
hrchilds's avatar
hrchilds committed
644 645
    connect(axesLineWidth2D, SIGNAL(lineWidthChanged(int)),
            this, SLOT(axesLineWidthChanged2D(int)));
whitlocb's avatar
whitlocb committed
646 647
    l = new QLabel(tr("Line width"), top);
    l->setBuddy(axesLineWidth2D);
whitlocb's avatar
whitlocb committed
648 649
    lLayout->addWidget(l, row, 0);
    ++row;
hrchilds's avatar
hrchilds committed
650

whitlocb's avatar
whitlocb committed
651
    return top;
hrchilds's avatar
hrchilds committed
652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672
}

// ****************************************************************************
// Method: QvisAnnotationWindow::Create3DTab
//
// Purpose: 
//   Creates the 3D options tab.
//
// Note:       I moved this code from CreateWindowContents.
//
// Programmer: Brad Whitlock
// Creation:   Thu Oct 30 16:34:53 PST 2003
//
// Modifications:
//   Kathleen Bonnell, Tue Dec 16 11:34:33 PST 2003
//   Added button for automatic label scaling, text fields for label exponents.
//
//   Brad Whitlock, Thu Jul 28 09:20:43 PDT 2005
//   I split it into two subtabs and added controls to set the axis titles
//   and units.
//
whitlocb's avatar
whitlocb committed
673 674 675
//   Brad Whitlock, Thu Feb 7 17:03:30 PST 2008
//   I split the tabs into "General 3D", "X-Axis", "Y-Axis", and "Z-Axis".
//
676 677 678
//   Brad Whitlock, Tue Apr  8 09:27:26 PDT 2008
//   Support for internationalization.
//
whitlocb's avatar
whitlocb committed
679 680 681
//   Brad Whitlock, Thu Jun 26 10:32:05 PDT 2008
//   Qt 4.
//
682 683 684 685 686
//   Jeremy Meredith, Thu Jan 22 14:53:22 EST 2009
//   Update just the various 3D sub-tabs sensitivity, not the entire
//   3D tab, when "show axes" is unchecked.  (If you set the whole
//   tab, then you've even disabled "show axes" and can't re-check it.)
//
hrchilds's avatar
hrchilds committed
687 688 689 690 691 692 693 694
// ****************************************************************************

void
QvisAnnotationWindow::Create3DTab()
{
    //
    // Create the group of 3D-related widgets.
    //
whitlocb's avatar
whitlocb committed
695 696 697 698
    page3D = new QWidget(central);
    QVBoxLayout *page3DLayout = new QVBoxLayout(page3D);
    page3DLayout->setSpacing(10);
    page3DLayout->setMargin(10);
699
    tabs->addTab(page3D, tr("3D"));
hrchilds's avatar
hrchilds committed
700 701

    // Create the toggle for drawing the axes.
whitlocb's avatar
whitlocb committed
702 703 704
    QHBoxLayout *buttonLayout = new QHBoxLayout(0);
    page3DLayout->addLayout(buttonLayout);
    axes3DVisible = new QCheckBox(tr("Show axes"), page3D);
whitlocb's avatar
whitlocb committed
705
    connect(axes3DVisible, SIGNAL(toggled(bool)),
hrchilds's avatar
hrchilds committed
706
            this, SLOT(axes3DFlagChecked(bool)));
whitlocb's avatar
whitlocb committed
707
    buttonLayout->addWidget(axes3DVisible);
hrchilds's avatar
hrchilds committed
708

whitlocb's avatar
whitlocb committed
709
    // Create the toggle for the triad.
whitlocb's avatar
whitlocb committed
710
    triadFlagToggle = new QCheckBox(tr("Show triad"), page3D);
whitlocb's avatar
whitlocb committed
711 712
    connect(triadFlagToggle, SIGNAL(toggled(bool)),
            this, SLOT(triadFlagChecked(bool)));
whitlocb's avatar
whitlocb committed
713
    buttonLayout->addWidget(triadFlagToggle);
whitlocb's avatar
whitlocb committed
714 715

    // Create the toggle for the bbox.
whitlocb's avatar
whitlocb committed
716
    bboxFlagToggle = new QCheckBox(tr("Show bounding box"), page3D);
whitlocb's avatar
whitlocb committed
717 718
    connect(bboxFlagToggle, SIGNAL(toggled(bool)),
            this, SLOT(bboxFlagChecked(bool)));
whitlocb's avatar
whitlocb committed
719
    buttonLayout->addWidget(bboxFlagToggle);
whitlocb's avatar
whitlocb committed
720

721
    page3DTabs = new QTabWidget(page3D);
whitlocb's avatar
whitlocb committed
722
    page3DLayout->addWidget(page3DTabs);
hrchilds's avatar
hrchilds committed
723

whitlocb's avatar
whitlocb committed
724 725
    // Create the general 3D options page.
    page3DTabs->addTab(CreateGeneralTab3D(page3DTabs),
726
        tr("General 3D"));
hrchilds's avatar
hrchilds committed
727

whitlocb's avatar
whitlocb committed
728
    // Add the X-axis page.
whitlocb's avatar
whitlocb committed
729
    axes3D[0] = new QvisAxisAttributesWidget(page3DTabs, true);
whitlocb's avatar
whitlocb committed
730 731
    connect(axes3D[0], SIGNAL(axisChanged(const AxisAttributes &)),
            this, SLOT(xAxisChanged(const AxisAttributes &)));
732
    page3DTabs->addTab(axes3D[0], tr("X-Axis"));
hrchilds's avatar
hrchilds committed
733

whitlocb's avatar
whitlocb committed
734
    // Add the Y-axis page.
whitlocb's avatar
whitlocb committed
735
    axes3D[1] = new QvisAxisAttributesWidget(page3DTabs, true);
whitlocb's avatar
whitlocb committed
736 737
    connect(axes3D[1], SIGNAL(axisChanged(const AxisAttributes &)),
            this, SLOT(yAxisChanged(const AxisAttributes &)));
738
    page3DTabs->addTab(axes3D[1], tr("Y-Axis"));
whitlocb's avatar
whitlocb committed
739 740

    // Add the Z-axis page.
whitlocb's avatar
whitlocb committed
741
    axes3D[2] = new QvisAxisAttributesWidget(page3DTabs, true);
whitlocb's avatar
whitlocb committed
742 743
    connect(axes3D[2], SIGNAL(axisChanged(const AxisAttributes &)),
            this, SLOT(zAxisChanged(const AxisAttributes &)));
744
    page3DTabs->addTab(axes3D[2], tr("Z-Axis"));
hrchilds's avatar
hrchilds committed
745 746 747
}

// ****************************************************************************
whitlocb's avatar
whitlocb committed
748
// Method: QvisAnnotationWindow::CreateGeneralTab3D
hrchilds's avatar
hrchilds committed
749 750
//
// Purpose: 
whitlocb's avatar
whitlocb committed
751
//   Creates the general 3D options page.
hrchilds's avatar
hrchilds committed
752 753
//
// Arguments:
whitlocb's avatar
whitlocb committed
754
//   parentWidget : The parent widget for the widgets that we're creating.
hrchilds's avatar
hrchilds committed
755
//
whitlocb's avatar
whitlocb committed
756
// Returns:    
hrchilds's avatar
hrchilds committed
757 758 759 760
//
// Note:       
//
// Programmer: Brad Whitlock
whitlocb's avatar
whitlocb committed
761
// Creation:   Thu Feb 7 17:07:22 PST 2008
hrchilds's avatar
hrchilds committed
762 763
//
// Modifications:
764 765
//   Brad Whitlock, Tue Apr  8 09:27:26 PDT 2008
//   Support for internationalization.
whitlocb's avatar
whitlocb committed
766 767 768 769
//
//   Brad Whitlock, Thu Jun 26 10:37:10 PDT 2008
//   Qt 4.
//
770 771 772
//   Hank Childs, Fri May 13 16:00:24 PDT 2011
//   Add widgets for setting bounding box location.
//
hrchilds's avatar
hrchilds committed
773 774 775
// ****************************************************************************

QWidget *
whitlocb's avatar
whitlocb committed
776
QvisAnnotationWindow::CreateGeneralTab3D(QWidget *parentWidget)
hrchilds's avatar
hrchilds committed
777
{
whitlocb's avatar
whitlocb committed
778 779 780 781 782 783
    QWidget *top = new QWidget(parentWidget);
    QVBoxLayout *vlayout = new QVBoxLayout(top);
    vlayout->setMargin(10);
    QGridLayout *rLayout = new QGridLayout(0);
    vlayout->addLayout(rLayout);
    vlayout->addStretch(100);
hrchilds's avatar
hrchilds committed
784
    rLayout->setSpacing(5);
whitlocb's avatar
whitlocb committed
785 786
    rLayout->setMargin(0);
    rLayout->setColumnStretch(1, 10);
whitlocb's avatar
whitlocb committed
787 788

    int row = 0;
whitlocb's avatar
whitlocb committed
789
    labelAutoSetScalingToggle = new QCheckBox(tr("Auto scale label values"), top);
whitlocb's avatar
whitlocb committed
790 791
    connect(labelAutoSetScalingToggle, SIGNAL(toggled(bool)),
            this, SLOT(labelAutoSetScalingChecked(bool)));
whitlocb's avatar
whitlocb committed
792
    rLayout->addWidget(labelAutoSetScalingToggle, row, 0, 1, 2);
whitlocb's avatar
whitlocb committed
793
    ++row;
hrchilds's avatar
hrchilds committed
794

whitlocb's avatar
whitlocb committed
795
    // Create auto set ticks check box.
whitlocb's avatar
whitlocb committed
796
    axesAutoSetTicksToggle = new QCheckBox(tr("Auto set ticks"), top);
whitlocb's avatar
whitlocb committed
797 798
    connect(axesAutoSetTicksToggle, SIGNAL(toggled(bool)),
            this, SLOT(axesAutoSetTicksChecked(bool)));
whitlocb's avatar
whitlocb committed
799
    rLayout->addWidget(axesAutoSetTicksToggle, row, 0, 1, 2);
whitlocb's avatar
whitlocb committed
800
    ++row;
hrchilds's avatar
hrchilds committed
801 802

    // Create the 3D tick mark locations combobox.
whitlocb's avatar
whitlocb committed
803 804 805 806
    axes3DTickLocationComboBox = new QComboBox(top);
    axes3DTickLocationComboBox->addItem(tr("Inside"));
    axes3DTickLocationComboBox->addItem(tr("Outside"));
    axes3DTickLocationComboBox->addItem(tr("Both"));
hrchilds's avatar
hrchilds committed
807 808
    connect(axes3DTickLocationComboBox, SIGNAL(activated(int)),
            this, SLOT(axes3DTickLocationChanged(int)));
whitlocb's avatar
whitlocb committed
809
    rLayout->addWidget(axes3DTickLocationComboBox, row, 1);
whitlocb's avatar
whitlocb committed
810 811
    QLabel *l = new QLabel(tr("Tick mark locations"), top);
    l->setBuddy(axes3DTickLocationComboBox);
whitlocb's avatar
whitlocb committed
812 813
    rLayout->addWidget(l, row, 0);
    ++row;
hrchilds's avatar
hrchilds committed
814 815

    // Create the 3D axes type combobox.
whitlocb's avatar
whitlocb committed
816 817 818 819 820 821
    axes3DTypeComboBox = new QComboBox(top);
    axes3DTypeComboBox->addItem(tr("Closest triad"));
    axes3DTypeComboBox->addItem(tr("Furthest triad"));
    axes3DTypeComboBox->addItem(tr("Outside edges"));
    axes3DTypeComboBox->addItem(tr("Static triad"));
    axes3DTypeComboBox->addItem(tr("Static edges"));
hrchilds's avatar
hrchilds committed
822 823
    connect(axes3DTypeComboBox, SIGNAL(activated(int)),
            this, SLOT(axes3DTypeChanged(int)));
whitlocb's avatar
whitlocb committed
824
    rLayout->addWidget(axes3DTypeComboBox, row, 1);
whitlocb's avatar
whitlocb committed
825 826
    l = new QLabel(tr("Axis type"), top);
    l->setBuddy(axes3DTypeComboBox);
whitlocb's avatar
whitlocb committed
827 828
    rLayout->addWidget(l, row, 0);
    ++row;
hrchilds's avatar
hrchilds committed
829

whitlocb's avatar
whitlocb committed
830
    // Create the 2D line width widget.
whitlocb's avatar
whitlocb committed
831
    axesLineWidth = new QvisLineWidthWidget(0, top);
whitlocb's avatar
whitlocb committed
832 833 834
    rLayout->addWidget(axesLineWidth, row, 1);
    connect(axesLineWidth, SIGNAL(lineWidthChanged(int)),
            this, SLOT(axesLineWidthChanged(int)));
whitlocb's avatar
whitlocb committed
835 836
    l = new QLabel(tr("Line width"), top);
    l->setBuddy(axesLineWidth);
whitlocb's avatar
whitlocb committed
837
    rLayout->addWidget(l, row, 0);
838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863
    ++row;

    setBBoxLocationToggle = new QCheckBox(tr("Set bounding box location manually"), top);
    connect(setBBoxLocationToggle, SIGNAL(toggled(bool)),
            this, SLOT(setBBoxLocationChecked(bool)));
    rLayout->addWidget(setBBoxLocationToggle, row, 0, 1, 2);
    ++row;
    
    std::vector<std::string> labels;
    labels.push_back("X-Minimum");
    labels.push_back("X-Maximum");
    labels.push_back("Y-Minimum");
    labels.push_back("Y-Maximum");
    labels.push_back("Z-Minimum");
    labels.push_back("Z-Maximum");

    for (int i = 0 ; i < 6 ; i++)
    {
      bboxLabels[i] = new QLabel(labels[i].c_str());
      rLayout->addWidget(bboxLabels[i], row, 0);
      bboxLocations[i] = new QNarrowLineEdit(top);
      rLayout->addWidget(bboxLocations[i], row, 1);
      ++row;
      connect(bboxLocations[i], SIGNAL(returnPressed()),
            this, SLOT(bboxLocationChanged()));
    }
hrchilds's avatar
hrchilds committed
864

whitlocb's avatar
whitlocb committed
865
    return top;
hrchilds's avatar
hrchilds committed
866 867
}

868 869 870 871 872 873 874 875 876 877
// ****************************************************************************
// Method: QvisAnnotationWindow::CreateArrayTab
//
// Purpose: 
//   Creates the AxisArray options tab.
//
// Programmer: Jeremy Meredith
// Creation:   November 18, 2008
//
// Modifications:
whitlocb's avatar
whitlocb committed
878 879
//   Brad Whitlock, Tue Nov 18 15:10:02 PST 2008
//   Qt 4.
880
//
881 882 883
//   Jeremy Meredith, Fri Jan 16 11:14:14 EST 2009
//   Hide the custom title/units and showGrid settings for the axes.
//
884 885 886 887 888 889 890 891
// ****************************************************************************

void
QvisAnnotationWindow::CreateArrayTab()
{
    //
    // Create the group of axisarray-related widgets and add them as a tab.
    //
whitlocb's avatar
whitlocb committed
892 893 894 895
    pageArray = new QWidget(central);
    QVBoxLayout *aLayout = new QVBoxLayout(pageArray);
    aLayout->setSpacing(5);
    aLayout->setMargin(10);
896 897
    tabs->addTab(pageArray, tr("Array"));

whitlocb's avatar
whitlocb committed
898 899
    axesFlagToggleArray = new QCheckBox(tr("Show axes"), pageArray);
    aLayout->addWidget(axesFlagToggleArray);
900 901 902
    connect(axesFlagToggleArray, SIGNAL(toggled(bool)),
            this, SLOT(axesFlagCheckedArray(bool)));

whitlocb's avatar
whitlocb committed
903 904
    axesArrayGroup = new QWidget(pageArray);
    aLayout->addWidget(axesArrayGroup);
905 906
    QVBoxLayout *lLayout = new QVBoxLayout(axesArrayGroup);
    lLayout->setSpacing(5);
whitlocb's avatar
whitlocb committed
907
    QTabWidget *pageArrayTabs = new QTabWidget(axesArrayGroup);
908 909 910 911 912 913
    lLayout->addWidget(pageArrayTabs);

    // Create the general options page.
    pageArrayTabs->addTab(CreateGeneralTabArray(pageArrayTabs), tr("General Array"));

    // Add the X-axis page.
914 915
    axesArray[0] = new QvisAxisAttributesWidget(pageArrayTabs, false, true,
                                                false, false);
916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937
    connect(axesArray[0], SIGNAL(axisChanged(const AxisAttributes &)),
            this, SLOT(axisChangedArray(const AxisAttributes &)));
    pageArrayTabs->addTab(axesArray[0], tr("Axes"));
}

// ****************************************************************************
// Method: QvisAnnotationWindow::CreateGeneralTabArray
//
// Purpose: 
//   Creates the options for the general AxisArray tab.
//
// Arguments:
//   parentWidget : The parent of the widgets we'll create.
//
// Returns:    
//
// Note:       
//
// Programmer: Jeremy Meredith
// Creation:   November 18, 2008
//
// Modifications:
whitlocb's avatar
whitlocb committed
938 939 940
//   Brad Whitlock, Tue Nov 18 15:13:09 PST 2008
//   Qt 4.
//
941 942 943 944 945
// ****************************************************************************

QWidget *
QvisAnnotationWindow::CreateGeneralTabArray(QWidget *parentWidget)
{
whitlocb's avatar
whitlocb committed
946 947 948 949 950 951
    QWidget *top = new QWidget(parentWidget);
    QVBoxLayout *vlayout = new QVBoxLayout(top);
    vlayout->setMargin(10);
    QGridLayout *lLayout = new QGridLayout(0);
    vlayout->addLayout(lLayout);
    vlayout->addStretch(100);
952
    lLayout->setSpacing(5);
whitlocb's avatar
whitlocb committed
953 954
    lLayout->setMargin(0);
    lLayout->setColumnStretch(1, 10);
955 956 957 958

    int row = 0;

    // Create ticks visible check box.
whitlocb's avatar
whitlocb committed
959
    ticksToggleArray = new QCheckBox(tr("Tick marks visible"), top);
960 961
    connect(ticksToggleArray, SIGNAL(toggled(bool)),
            this, SLOT(axesTicksChangedArray(bool)));
whitlocb's avatar
whitlocb committed
962
    lLayout->addWidget(ticksToggleArray, row, 0);
963 964 965
    ++row;

    // Create auto set scaling check box.
whitlocb's avatar
whitlocb committed
966
    labelAutoSetScalingToggleArray = new QCheckBox(tr("Auto scale label values"), top);
967 968
    connect(labelAutoSetScalingToggleArray, SIGNAL(toggled(bool)),
            this, SLOT(labelAutoSetScalingCheckedArray(bool)));
whitlocb's avatar
whitlocb committed
969
    lLayout->addWidget(labelAutoSetScalingToggleArray, row, 0);
970 971 972
    ++row;

    // Create auto set ticks check box.
whitlocb's avatar
whitlocb committed
973
    axesAutoSetTicksToggleArray = new QCheckBox(tr("Auto set ticks"), top);
974 975
    connect(axesAutoSetTicksToggleArray, SIGNAL(toggled(bool)),
            this, SLOT(axesAutoSetTicksCheckedArray(bool)));
whitlocb's avatar
whitlocb committed
976
    lLayout->addWidget(axesAutoSetTicksToggleArray, row, 0);
977 978 979
    ++row;

    // Create the Array line width widget.
whitlocb's avatar
whitlocb committed
980
    axesLineWidthArray = new QvisLineWidthWidget(0, top);
981 982 983
    lLayout->addWidget(axesLineWidthArray, row, 1);
    connect(axesLineWidthArray, SIGNAL(lineWidthChanged(int)),
            this, SLOT(axesLineWidthChangedArray(int)));
whitlocb's avatar
whitlocb committed
984
    QLabel *l = new QLabel(tr("Line width"), top);
985 986 987
    lLayout->addWidget(l, row, 0);
    ++row;

whitlocb's avatar
whitlocb committed
988
    return top;
989 990 991
}


hrchilds's avatar
hrchilds committed
992 993 994 995 996 997 998 999 1000 1001 1002 1003
// ****************************************************************************
// Method: QvisAnnotationWindow::CreateColorTab
//
// Purpose: 
//   Creates the color tab.
//
// Note:       This code used to be in CreateWindowContents.
//
// Programmer: Brad Whitlock
// Creation:   Thu Oct 30 16:33:39 PST 2003
//
// Modifications:
1004 1005 1006
//   Brad Whitlock, Wed Nov 14 11:34:45 PDT 2007
//   Added background image support.
//
1007 1008 1009
//   Brad Whitlock, Tue Apr  8 09:27:26 PDT 2008
//   Support for internationalization.
//
whitlocb's avatar
whitlocb committed
1010 1011 1012
//   Brad Whitlock, Thu Jun 26 10:40:10 PDT 2008
//   Qt 4.
//
hrchilds's avatar
hrchilds committed
1013 1014 1015 1016 1017
// ****************************************************************************

void
QvisAnnotationWindow::CreateColorTab()
{
1018 1019
    int row = 0;

hrchilds's avatar
hrchilds committed
1020 1021 1022
    //
    // Create the group of color-related widgets.
    //
whitlocb's avatar
whitlocb committed
1023
    pageColor = new QWidget(central);
1024
    tabs->addTab(pageColor, tr("Colors"));
hrchilds's avatar
hrchilds committed
1025 1026 1027

    QVBoxLayout *vcLayout = new QVBoxLayout(pageColor);
    vcLayout->setMargin(10);
whitlocb's avatar
whitlocb committed
1028
    QGridLayout *cLayout = new QGridLayout(0);
hrchilds's avatar
hrchilds committed
1029
    cLayout->setSpacing(10);
whitlocb's avatar
whitlocb committed
1030
    vcLayout->addLayout(cLayout);
hrchilds's avatar
hrchilds committed
1031 1032

    // Add the background color widgets.
whitlocb's avatar
whitlocb committed
1033
    backgroundColorButton = new QvisColorButton(pageColor);
hrchilds's avatar
hrchilds committed
1034 1035
    connect(backgroundColorButton, SIGNAL(selectedColor(const QColor &)),
            this, SLOT(backgroundColorChanged(const QColor &)));
whitlocb's avatar
whitlocb committed
1036 1037
    QLabel *bgColorLabel = new QLabel(tr("Background color"), pageColor);
    bgColorLabel->setBuddy(backgroundColorButton);
1038
    cLayout->addWidget(bgColorLabel, row, 0);
whitlocb's avatar
whitlocb committed
1039
    cLayout->addWidget(backgroundColorButton, row, 1, Qt::AlignLeft);
1040
    ++row;
hrchilds's avatar
hrchilds committed
1041 1042

    // Add the foreground color widgets.
whitlocb's avatar
whitlocb committed
1043
    foregroundColorButton = new QvisColorButton(pageColor);
hrchilds's avatar
hrchilds committed
1044 1045
    connect(foregroundColorButton, SIGNAL(selectedColor(const QColor &)),
            this, SLOT(foregroundColorChanged(const QColor &)));
whitlocb's avatar
whitlocb committed
1046 1047
    QLabel *fgColorLabel = new QLabel(tr("Foreground color"), pageColor);
    fgColorLabel->setBuddy(foregroundColorButton);
1048
    cLayout->addWidget(fgColorLabel, row, 0);
whitlocb's avatar
whitlocb committed
1049
    cLayout->addWidget(foregroundColorButton, row, 1, Qt::AlignLeft);
1050
    ++row;
hrchilds's avatar
hrchilds committed
1051 1052

    // Create the background style widgets.
whitlocb's avatar
whitlocb committed
1053
    QLabel *backgroundStyleLabel = new QLabel(tr("Background style"), pageColor);
1054
    cLayout->addWidget(backgroundStyleLabel, row, 0);
whitlocb's avatar
whitlocb committed
1055 1056
    backgroundStyleButtons = new QButtonGroup(pageColor);
    connect(backgroundStyleButtons, SIGNAL(buttonClicked(int)),
hrchilds's avatar
hrchilds committed
1057
            this, SLOT(backgroundStyleChanged(int)));
whitlocb's avatar
whitlocb committed
1058 1059 1060 1061
    QGridLayout *mLayout = new QGridLayout(0);
    cLayout->addLayout(mLayout, row, 1, 1, 4);
    QRadioButton *solid = new QRadioButton(tr("Solid"), pageColor);
    backgroundStyleButtons->addButton(solid, 0);
1062
    mLayout->addWidget(solid, 0, 0);
whitlocb's avatar
whitlocb committed
1063 1064
    QRadioButton *gradient = new QRadioButton(tr("Gradient"), pageColor);
    backgroundStyleButtons->addButton(gradient, 1);
1065
    mLayout->addWidget(gradient, 0, 1);
whitlocb's avatar
whitlocb committed
1066 1067
    QRadioButton *image = new QRadioButton(tr("Image"), pageColor);
    backgroundStyleButtons->addButton(image, 2);
1068
    mLayout->addWidget(image, 0, 2);
whitlocb's avatar
whitlocb committed
1069 1070
    QRadioButton *imageSphere = new QRadioButton(tr("Image sphere"), pageColor);
    backgroundStyleButtons->addButton(imageSphere, 3);
1071 1072 1073
    mLayout->addWidget(imageSphere, 0, 3);
    ++row;

whitlocb's avatar
whitlocb committed
1074
    QFrame *splitter = new QFrame(pageColor);
1075
    splitter->setFrameStyle(QFrame::HLine + QFrame::Raised);
whitlocb's avatar
whitlocb committed
1076
    cLayout->addWidget(splitter, row, 0, 1, 5);
1077
    ++row;
hrchilds's avatar
hrchilds committed
1078 1079

    // Create the gradient style combobox.
whitlocb's avatar
whitlocb committed
1080 1081 1082 1083 1084 1085
    gradientStyleComboBox = new QComboBox(pageColor);
    gradientStyleComboBox->addItem(tr("Top to bottom"));
    gradientStyleComboBox->addItem(tr("Bottom to top"));
    gradientStyleComboBox->addItem(tr("Left to right"));
    gradientStyleComboBox->addItem(tr("Right to left"));
    gradientStyleComboBox->addItem(tr("Radial"));
hrchilds's avatar
hrchilds committed
1086 1087
    connect(gradientStyleComboBox, SIGNAL(activated(int)),
            this, SLOT(gradientStyleChanged(int)));
whitlocb's avatar
whitlocb committed
1088 1089 1090
    cLayout->addWidget(gradientStyleComboBox, row, 1, 1, 4);
    gradientStyleLabel = new QLabel(tr("Gradient style"), pageColor);
    gradientStyleLabel->setBuddy(gradientStyleComboBox);
1091 1092
    cLayout->addWidget(gradientStyleLabel, row, 0);
    ++row;
hrchilds's avatar
hrchilds committed
1093 1094

    // Add the gradient color1 widgets.
whitlocb's avatar
whitlocb committed
1095
    gradientColor1Button = new QvisColorButton(pageColor);
hrchilds's avatar
hrchilds committed
1096 1097
    connect(gradientColor1Button, SIGNAL(selectedColor(const QColor &)),
            this, SLOT(gradientColor1Changed(const QColor &)));
whitlocb's avatar
whitlocb committed
1098 1099
    gradientColor1Label = new QLabel(tr("Gradient color 1"), pageColor);
    gradientColor1Label->setBuddy(gradientColor1Button);
1100
    cLayout->addWidget(gradientColor1Label, row, 0);
whitlocb's avatar
whitlocb committed
1101
    cLayout->addWidget(gradientColor1Button, row, 1, Qt::AlignLeft);
1102
    ++row;
hrchilds's avatar
hrchilds committed
1103 1104

    // Add the gradiant color2 widgets.
whitlocb's avatar
whitlocb committed
1105
    gradientColor2Button = new QvisColorButton(pageColor);
hrchilds's avatar
hrchilds committed
1106 1107
    connect(gradientColor2Button, SIGNAL(selectedColor(const QColor &)),
            this, SLOT(gradientColor2Changed(const QColor &)));
whitlocb's avatar
whitlocb committed
1108 1109
    gradientColor2Label = new QLabel(tr("Gradient color 2"), pageColor);
    gradientColor2Label->setBuddy(gradientColor2Button);
1110
    cLayout->addWidget(gradientColor2Label, row, 0);
whitlocb's avatar
whitlocb committed
1111
    cLayout->addWidget(gradientColor2Button, row, 1, Qt::AlignLeft);
1112 1113
    ++row;

whitlocb's avatar
whitlocb committed
1114
    QFrame *splitter2 = new QFrame(pageColor);
1115
    splitter2->setFrameStyle(QFrame::HLine + QFrame::Raised);
whitlocb's avatar
whitlocb committed
1116
    cLayout->addWidget(splitter2, row, 0, 1, 5);  
1117 1118 1119
    ++row;

    // Add the image selection widget
whitlocb's avatar
whitlocb committed
1120
    backgroundImage = new QvisDialogLineEdit(pageColor);
1121 1122 1123
    backgroundImage->setDialogMode(QvisDialogLineEdit::ChooseLocalFile);
    connect(backgroundImage, SIGNAL(returnPressed()),
            this, SLOT(backgroundImageChanged()));
whitlocb's avatar
whitlocb committed
1124 1125 1126
    cLayout->addWidget(backgroundImage, row, 1, 1, 4);
    backgroundImageLabel = new QLabel(tr("Background image"), pageColor);
    backgroundImageLabel->setBuddy(backgroundImage);
1127
    cLayout->addWidget(backgroundImageLabel, row, 0);
1128 1129
    QString disclaimer(tr("The local file must be accessible to the "
        "compute engine in order to be used in scalable rendering mode."));
whitlocb's avatar
whitlocb committed
1130 1131
    backgroundImage->setToolTip(disclaimer);
    backgroundImageLabel->setToolTip(disclaimer);
1132 1133 1134
    ++row;

    // Add the image repeat x,y widgets. 
whitlocb's avatar
whitlocb committed
1135 1136 1137
    imageRepeatX = new QSpinBox(pageColor);
    imageRepeatX->setMinimum(1);
    imageRepeatX->setMaximum(100);
1138 1139 1140 1141
    imageRepeatX->setButtonSymbols(QSpinBox::PlusMinus);
    connect(imageRepeatX, SIGNAL(valueChanged(int)),
            this, SLOT(imageRepeatXChanged(int)));
    cLayout->addWidget(imageRepeatX, row, 1);
whitlocb's avatar
whitlocb committed
1142 1143
    imageRepeatXLabel = new QLabel(tr("Repetitions in X"), pageColor);
    imageRepeatXLabel->setBuddy(imageRepeatX);
1144 1145 1146
    cLayout->addWidget(imageRepeatXLabel, row, 0);
    ++row;

whitlocb's avatar
whitlocb committed
1147 1148 1149
    imageRepeatY = new QSpinBox(pageColor);
    imageRepeatY->setMinimum(1);
    imageRepeatY->setMaximum(100);
1150 1151 1152 1153
    imageRepeatY->setButtonSymbols(QSpinBox::PlusMinus);
    connect(imageRepeatY, SIGNAL(valueChanged(int)),
            this, SLOT(imageRepeatYChanged(int)));
    cLayout->addWidget(imageRepeatY, row, 1);
whitlocb's avatar
whitlocb committed
1154 1155
    imageRepeatYLabel = new QLabel(tr("Repetitions in Y"), pageColor);
    imageRepeatYLabel->setBuddy(imageRepeatY);
1156 1157 1158
    cLayout->addWidget(imageRepeatYLabel, row, 0);
    ++row;

hrchilds's avatar
hrchilds committed
1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171
    vcLayout->addStretch(50);
}

// ****************************************************************************
// Method: QvisAnnotationWindow::CreateObjectsTab
//
// Purpose: 
//   Creates the objects tab.
//
// Programmer: Brad Whitlock
// Creation:   Thu Oct 30 17:00:19 PST 2003
//
// Modifications:
hrchilds's avatar
hrchilds committed
1172 1173 1174
//   Brad Whitlock, Tue Mar 20 15:19:03 PST 2007
//   Made it so some interfaces don't have to provide a new instance button.
//
1175 1176 1177
//   Brad Whitlock, Tue Apr  8 09:27:26 PDT 2008
//   Support for internationalization.
//
whitlocb's avatar
whitlocb committed
1178 1179 1180
//   Brad Whitlock, Thu Jun 26 11:00:21 PDT 2008
//   Qt 4.
//
hrchilds's avatar
hrchilds committed
1181 1182 1183 1184 1185 1186 1187 1188
// ****************************************************************************

void
QvisAnnotationWindow::CreateObjectsTab()
{
    //
    // Create the group of color-related widgets.
    //
whitlocb's avatar
whitlocb committed
1189
    pageObjects = new QWidget(central);
1190
    tabs->addTab(pageObjects, tr("Objects"));
hrchilds's avatar
hrchilds committed
1191 1192 1193 1194 1195

    QVBoxLayout *objTopLayout = new QVBoxLayout(pageObjects);
    objTopLayout->setMargin(10);
    objTopLayout->setSpacing(5);

whitlocb's avatar
whitlocb committed
1196 1197 1198
    QHBoxLayout *hLayout = new QHBoxLayout(0);
    hLayout->setMargin(0);
    objTopLayout->addLayout(hLayout);
hrchilds's avatar
hrchilds committed
1199 1200 1201 1202

    //
    // Create the buttons that let us create new annotation objects.
    //
whitlocb's avatar
whitlocb committed
1203
    QGroupBox *newObjectGroup = new QGroupBox(pageObjects);
1204
    newObjectGroup->setTitle(tr("Create new"));
hrchilds's avatar
hrchilds committed
1205 1206 1207 1208 1209
    hLayout->addWidget(newObjectGroup);

    QVBoxLayout *objButtonLayout = new QVBoxLayout(newObjectGroup);
    objButtonLayout->setMargin(10);
    objButtonLayout->setSpacing(5);
whitlocb's avatar
whitlocb committed
1210 1211
    objButtonGroup = new QButtonGroup(newObjectGroup);
    connect(objButtonGroup, SIGNAL(buttonClicked(int)),
hrchilds's avatar
hrchilds committed
1212 1213 1214 1215 1216
            this, SLOT(addNewAnnotationObject(int)));

    //
    // Create the annotation object list and controls to do things to them.
    //
whitlocb's avatar
whitlocb committed
1217 1218 1219
    QGridLayout *annotListLayout = new QGridLayout(0);
    annotListLayout->setMargin(0);
    hLayout->addLayout(annotListLayout);