Spreadsheet.code 21.2 KB
Newer Older
hrchilds's avatar
hrchilds committed
1 2 3 4 5 6 7 8 9
Function: ChangesRequireRecalculation
Declaration: bool ChangesRequireRecalculation(const SpreadsheetAttributes &) const;
Definition:
bool
SpreadsheetAttributes::ChangesRequireRecalculation(const SpreadsheetAttributes &obj) const
{
    return (subsetName != obj.subsetName);
}

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Function: CopyAttributes
Declaration: bool CopyAttributes(const AttributeGroup *atts);
Definition:
// ****************************************************************************
// Method: SpreadsheetAttributes::CopyAttributes
//
// Purpose:
//   CopyAttributes method for the SpreadsheetAttributes class.
//
// Note:       Autogenerated by xml2atts.
//
// Programmer: Hank Childs
// Creation:   August 31, 2007
//
// Modifications:
ghweber's avatar
ghweber committed
25 26 27
//   Gunther H. Weber, Fri Sep 14 11:33:48 PDT 2007
//   Copy pick letters. Move clearing of pick history to custom
//   SetSubsetName() method.
28
//
whitlocb's avatar
whitlocb committed
29 30 31
//   Brad Whitlock, Thu May 21 14:43:24 PDT 2009
//   Use pick element and type instead of the pick point.
//
32 33 34
//   Brad Whitlock, Wed Jun 27 16:04:29 PDT 2012
//   Do not turn off the tracer plane if we're just clearing picks.
//
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
// ****************************************************************************

bool
SpreadsheetAttributes::CopyAttributes(const AttributeGroup *atts)
{
    if (atts->TypeName() == "PlaneAttributes")
    {
        PlaneAttributes *p = (PlaneAttributes *) atts;
        const double *n = p->GetNormal();
        if (fabs(n[2]) >= fabs(n[0]) && fabs(n[2]) >= fabs(n[1]))
            SetNormal(Z);
        else if (fabs(n[1]) >= fabs(n[0]) && fabs(n[1]) >= fabs(n[2]))
            SetNormal(Y);
        else
            SetNormal(X);
        return true;
    }
    if (atts->TypeName() == "PickAttributes")
    {
        PickAttributes *p = (PickAttributes *) atts;
ghweber's avatar
ghweber committed
55 56 57

        // Handle a clear of pick points
        if (p->GetClearWindow())
58
        {
ghweber's avatar
ghweber committed
59 60 61 62
            pastPicks.clear();
            pastPickLetters.clear();
            currentPickValid = false;
            return true;
63 64
        }

65 66 67 68
        // If we got this from a pick, then the tracer plane will just
        // get in the way, so turn it off.
        SetShowTracerPlane(false);

ghweber's avatar
ghweber committed
69
        // Handle subset changes
70 71 72 73 74 75
        if (p->GetSubsetName() != "" &&
            p->GetSubsetName() != subsetName)
        {
            SetSubsetName(p->GetSubsetName());
        }

ghweber's avatar
ghweber committed
76 77 78
        // Add current pick to history, if valid
        if (currentPickValid)
        {
whitlocb's avatar
whitlocb committed
79 80
            pastPicks.push_back(GetCurrentPick());
            pastPicks.push_back(GetCurrentPickType());
ghweber's avatar
ghweber committed
81 82 83 84 85
            pastPickLetters.push_back(GetCurrentPickLetter());
        }

        // Set current pick based on history
        currentPickValid = true;
whitlocb's avatar
whitlocb committed
86 87
        SetCurrentPick(p->GetElementNumber());
        SetCurrentPickType((int)p->GetPickType());
ghweber's avatar
ghweber committed
88 89
        SetCurrentPickLetter(p->GetPickLetter());

90 91 92 93 94 95 96 97 98 99 100 101 102
        return true;
    }

    if(TypeName() != atts->TypeName())
        return false;

    // Call assignment operator.
    const SpreadsheetAttributes *tmp = (const SpreadsheetAttributes *)atts;
    *this = *tmp;

    return true;
}

ghweber's avatar
ghweber committed
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
Function: CreateCompatible
Declaration: virtual AttributeSubject *CreateCompatible(const std::string &) const;
Definition:
// ****************************************************************************
// Method: SpreadsheetAttributes::CreateCompatible
//
// Purpose:
//   CreateCompatible method for the SpreadsheetAttributes class.
//
// Programmer: Hank Childs
// Creation:   September 14, 2007
//
// Modifications:
//
// ****************************************************************************

AttributeSubject *
SpreadsheetAttributes::CreateCompatible(const std::string &tname) const
{
    AttributeSubject *retval = 0;
    if(TypeName() == tname)
        retval = new SpreadsheetAttributes(*this);
    else if (tname == "PickAttributes")
    {
        PickAttributes *p = new PickAttributes();
        p->SetSubsetName(GetSubsetName());
        retval = p;
    }
    return retval;
}

Function: SetSubsetName
whitlocb's avatar
whitlocb committed
135
Declaration: void SetSubsetName(const std::string &subsetName_);
ghweber's avatar
ghweber committed
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
Definition:
// ****************************************************************************
// Method: SpreadsheetAttributes::SetSubsetName
//
// Purpose:
//   Custom SetSubsetName method for the SpreadsheetAttributes class
//   that clears the pick history if the subset changes.
//
// Note:       Autogenerated by xml2atts.
//
// Programmer: Gunther H. Weber
// Creation:   September 13, 2007
//
// Modifications:
//
// ****************************************************************************

void
SpreadsheetAttributes::SetSubsetName(const std::string &subsetName_)
{
    subsetName = subsetName_;
    pastPicks.clear();
    pastPickLetters.clear();
    SetCurrentPickValid(false);
    Select(0, (void *)&subsetName);
}

whitlocb's avatar
whitlocb committed
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 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 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 264 265 266 267 268 269 270
Function: CreateNode
Declaration: bool CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd);
Definition:
// ****************************************************************************
// Method: SpreadsheetAttributes::CreateNode
//
// Purpose: 
//   This method creates a DataNode representation of the object so it can be saved to a config file.
//
// Note:       Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:   omitted
//
// Modifications:
//   Brad Whitlock, Tue May 26 11:42:36 PDT 2009
//   Prevent the pick-related attributes from being saved.
//
// ****************************************************************************

bool
SpreadsheetAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
    if(parentNode == 0)
        return false;

    SpreadsheetAttributes defaultObject;
    bool addToParent = false;
    // Create a node for SpreadsheetAttributes.
    DataNode *node = new DataNode("SpreadsheetAttributes");

    if(completeSave || !FieldsEqual(ID_subsetName, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("subsetName", subsetName));
    }

    if(completeSave || !FieldsEqual(ID_formatString, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("formatString", formatString));
    }

    if(completeSave || !FieldsEqual(ID_useColorTable, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("useColorTable", useColorTable));
    }

    if(completeSave || !FieldsEqual(ID_colorTableName, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("colorTableName", colorTableName));
    }

    if(completeSave || !FieldsEqual(ID_showTracerPlane, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("showTracerPlane", showTracerPlane));
    }

        DataNode *tracerColorNode = new DataNode("tracerColor");
        if(tracerColor.CreateNode(tracerColorNode, completeSave, true))
        {
            addToParent = true;
            node->AddNode(tracerColorNode);
        }
        else
            delete tracerColorNode;
    if(completeSave || !FieldsEqual(ID_normal, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("normal", NormalAxis_ToString(normal)));
    }

    if(completeSave || !FieldsEqual(ID_sliceIndex, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("sliceIndex", sliceIndex));
    }

    if(completeSave || !FieldsEqual(ID_spreadsheetFont, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("spreadsheetFont", spreadsheetFont));
    }

    if(completeSave || !FieldsEqual(ID_showPatchOutline, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("showPatchOutline", showPatchOutline));
    }

    if(completeSave || !FieldsEqual(ID_showCurrentCellOutline, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("showCurrentCellOutline", showCurrentCellOutline));
    }

    // Add the node to the parent node.
    if(addToParent || forceAdd)
        parentNode->AddNode(node);
    else
        delete node;

    return (addToParent || forceAdd);
}

271 272
Target: xml2info
Function: SpreadsheetViewerPluginInfo::InitializePlotAtts
273
Declaration: virtual void InitializePlotAtts(AttributeSubject *atts, const ViewerPlot *);
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293
Definition:
// ****************************************************************************
// Method: SpreadsheetViewerPluginInfo::InitializePlotAtts
//
// Purpose: 
//   Initializes the plot attributes.
//
// Arguments:
//   atts    : The plot attributes to check.
//   md      : The plot metadata.
//   varName : The plot variable.
//
// Programmer: Brad Whitlock
// Creation:   Wed Feb 21 11:36:13 PDT 2007
//
// Modifications:
//   
// ****************************************************************************
void
SpreadsheetViewerPluginInfo::InitializePlotAtts(AttributeSubject *atts,
294
    const ViewerPlot *plot)
295 296 297 298 299 300 301
{
    *(SpreadsheetAttributes*)atts = *defaultAtts;

    PrivateSetPlotAtts(atts, plot);
}

Function: SpreadsheetViewerPluginInfo::ReInitializePlotAtts
302
Declaration: virtual void ReInitializePlotAtts(AttributeSubject *atts, const ViewerPlot *);
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322
Definition:
// ****************************************************************************
// Method: SpreadsheetViewerPluginInfo::ReInitializePlotAtts
//
// Purpose: 
//   Makes sure that the subset name in the plot attributes is valid.
//
// Arguments:
//   atts    : The plot attributes to check.
//   md      : The plot metadata.
//   varName : The plot variable.
//
// Programmer: Brad Whitlock
// Creation:   Wed Feb 21 11:36:13 PDT 2007
//
// Modifications:
//   
// ****************************************************************************
void
SpreadsheetViewerPluginInfo::ReInitializePlotAtts(AttributeSubject *atts,
323
    const ViewerPlot *plot)
324 325 326 327 328
{
    PrivateSetPlotAtts(atts, plot);
}

Function: SpreadsheetViewerPluginInfo::ResetPlotAtts
329
Declaration: virtual void ResetPlotAtts(AttributeSubject *atts, const ViewerPlot *);
330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350
Definition:
// ****************************************************************************
// Method: SpreadsheetViewerPluginInfo::ResetPlotAtts
//
// Purpose: 
//   Resets the plot attributes.
//
// Arguments:
//   atts    : The plot attributes to reset.
//   md      : The plot metadata.
//   varName : The plot variable.
//
// Programmer: Brad Whitlock
// Creation:   Wed Feb 21 11:36:13 PDT 2007
//
// Modifications:
//   
// ****************************************************************************

void
SpreadsheetViewerPluginInfo::ResetPlotAtts(AttributeSubject *atts,
351
    const ViewerPlot *plot)
352 353 354 355 356 357 358 359

{
    *(SpreadsheetAttributes*)atts = *defaultAtts;

    PrivateSetPlotAtts(atts, plot);
}

Function: SpreadsheetViewerPluginInfo::ProvidesLegend
whitlocb's avatar
whitlocb committed
360
Declaration: virtual bool ProvidesLegend() const;
361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389
Definition:
bool
SpreadsheetViewerPluginInfo::ProvidesLegend() const
{
    return false;
}

Function: SpreadsheetViewerPluginInfo::AlternateDisplayCreate
Declaration: virtual void *AlternateDisplayCreate(ViewerPlot *plot);
Definition:
// ****************************************************************************
// Method: SpreadsheetViewerPluginInfo::AlternateDisplayCreate
//
// Purpose: 
//   Creates an alternate display that will display data for the Spreadsheet
//   plot.
//
// Arguments:
//   plot : Pointer to the ViewerPlot that will own the alternate display.
//
// Returns:    A pointer to the alternate display.
//
// Note:       We refer to the alternate display using void* so it can be
//             whatever type of display that is most appropriate Qt, X, ...
//
// Programmer: Brad Whitlock
// Creation:   Wed Feb 21 10:53:23 PDT 2007
//
// Modifications:
390 391 392
//   Brad Whitlock, Mon Aug 11 16:24:41 PDT 2008
//   Removed name argument from SpreadsheetViewer constructor.
//
393 394 395 396 397 398 399 400 401 402 403
// ****************************************************************************
#include <SpreadsheetViewer.h>
#include <avtCallback.h>
void *
SpreadsheetViewerPluginInfo::AlternateDisplayCreate(ViewerPlot *plot)
{
    void *dpy = 0;

    if(!avtCallback::GetNowinMode())
    {
        // We're not in nowin mode so create the spreadsheet viewer.
404
        SpreadsheetViewer *win = new SpreadsheetViewer(plot, 0);
405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 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 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589
        dpy = (void *)win;
    }

    return dpy;
}

Function: SpreadsheetViewerPluginInfo::AlternateDisplayDestroy
Declaration: virtual void AlternateDisplayDestroy(void *dpy);
Definition:
// ****************************************************************************
// Method: SpreadsheetViewerPluginInfo::AlternateDisplayDestroy
//
// Purpose: 
//   This method is called when the alternate display must be destroyed.
//
// Arguments:
//   dpy : The handle to the alternate display.
//
// Programmer: Brad Whitlock
// Creation:   Wed Feb 21 10:55:03 PDT 2007
//
// Modifications:
//   
// ****************************************************************************

void 
SpreadsheetViewerPluginInfo::AlternateDisplayDestroy(void *dpy)
{
    if(dpy != 0)
    {
        SpreadsheetViewer *v = (SpreadsheetViewer *)dpy;
        delete v;
    }
}

Function: SpreadsheetViewerPluginInfo::AlternateDisplayClear
Declaration: virtual void AlternateDisplayClear(void *dpy);
Definition:
// ****************************************************************************
// Method: SpreadsheetViewerPluginInfo::AlternateDisplayClear
//
// Purpose: 
//   This method is called when the alternate display must be cleared of data.
//
// Arguments:
//   dpy : The handle to the alternate display.
//
// Programmer: Brad Whitlock
// Creation:   Wed Feb 21 10:55:03 PDT 2007
//
// Modifications:
//   
// ****************************************************************************

void 
SpreadsheetViewerPluginInfo::AlternateDisplayClear(void *dpy)
{
    if(dpy != 0)
    {
        SpreadsheetViewer *v = (SpreadsheetViewer *)dpy;
        v->clear();
    }
}

Function: SpreadsheetViewerPluginInfo::AlternateDisplayHide
Declaration: virtual void AlternateDisplayHide(void *dpy);
Definition:
// ****************************************************************************
// Method: SpreadsheetViewerPluginInfo::AlternateDisplayHide
//
// Purpose: 
//   This method is called when the alternate display must be hidden.
//
// Arguments:
//   dpy : The handle to the alternate display.
//
// Programmer: Brad Whitlock
// Creation:   Wed Feb 21 10:55:03 PDT 2007
//
// Modifications:
//   
// ****************************************************************************

void 
SpreadsheetViewerPluginInfo::AlternateDisplayHide(void *dpy)
{
    if(dpy != 0)
    {
        SpreadsheetViewer *v = (SpreadsheetViewer *)dpy;
        v->hide();
    }
}

Function: SpreadsheetViewerPluginInfo::AlternateDisplayShow
Declaration: virtual void AlternateDisplayShow(void *dpy);
Definition:
// ****************************************************************************
// Method: SpreadsheetViewerPluginInfo::AlternateDisplayShow
//
// Purpose: 
//   This method is called when the alternate display must be shown.
//
// Arguments:
//   dpy : The handle to the alternate display.
//
// Programmer: Brad Whitlock
// Creation:   Wed Feb 21 10:55:03 PDT 2007
//
// Modifications:
//   
// ****************************************************************************

void 
SpreadsheetViewerPluginInfo::AlternateDisplayShow(void *dpy)
{
    if(dpy != 0)
    {
        SpreadsheetViewer *v = (SpreadsheetViewer *)dpy;
        if(v->isMinimized())
            v->showNormal();
        else
            v->show();
        v->raise();
    }
}

Function: SpreadsheetViewerPluginInfo::AlternateDisplayIconify
Declaration: virtual void AlternateDisplayIconify(void *dpy);
Definition:
// ****************************************************************************
// Method: SpreadsheetViewerPluginInfo::AlternateDisplayIconify
//
// Purpose: 
//   This method is called when the alternate display must be iconified.
//
// Arguments:
//   dpy : The handle to the alternate display.
//
// Programmer: Brad Whitlock
// Creation:   Wed Feb 21 10:55:03 PDT 2007
//
// Modifications:
//   
// ****************************************************************************

void 
SpreadsheetViewerPluginInfo::AlternateDisplayIconify(void *dpy)
{
    if(dpy != 0)
    {
        SpreadsheetViewer *v = (SpreadsheetViewer *)dpy;
        v->showMinimized();
    }
}

Function: SpreadsheetViewerPluginInfo::AlternateDisplayDeIconify
Declaration: virtual void AlternateDisplayDeIconify(void *dpy);
Definition:
// ****************************************************************************
// Method: SpreadsheetViewerPluginInfo::AlternateDisplayDeIconify
//
// Purpose: 
//   This method is called when the alternate display must be de-iconified.
//
// Arguments:
//   dpy : The handle to the alternate display.
//
// Programmer: Brad Whitlock
// Creation:   Wed Feb 21 10:55:03 PDT 2007
//
// Modifications:
//   
// ****************************************************************************

void 
SpreadsheetViewerPluginInfo::AlternateDisplayDeIconify(void *dpy)
{
    if(dpy != 0)
    {
        SpreadsheetViewer *v = (SpreadsheetViewer *)dpy;
        v->showNormal();
    }
}

Function: SpreadsheetViewerPluginInfo::PrivateSetPlotAtts
590
Declaration: void   PrivateSetPlotAtts(AttributeSubject *atts, const ViewerPlot *);
591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606
Definition:
// ****************************************************************************
// Method: SpreadsheetViewerPluginInfo::PrivateSetPlotAtts
//
// Purpose: 
//   Makes sure that the subset name in the plot attributes is valid.
//
// Arguments:
//   atts    : The plot attributes to check.
//   md      : The plot metadata.
//   varName : The plot variable.
//
// Programmer: Brad Whitlock
// Creation:   Wed Feb 21 11:36:13 PDT 2007
//
// Modifications:
607 608 609
//   Hank Childs, Mon Dec 14 16:04:01 PST 2009
//   Add support for new SIL interface.
//
610 611 612
//   Brad Whitlock, Thu Jun  3 14:39:43 PDT 2010
//   I fixed a bug with the SIL changes.
//
613 614 615 616 617 618
// ****************************************************************************
#include <avtSILRestriction.h>
#include <ViewerPlot.h>

void
SpreadsheetViewerPluginInfo::PrivateSetPlotAtts(AttributeSubject *atts, 
619
    const ViewerPlot *plot)
620 621 622 623 624 625 626 627 628 629 630
{
    // Search for a SIL_DOMAIN category under the current silTopSet and add
    // sets that are used.
    SpreadsheetAttributes *sAtts = (SpreadsheetAttributes *)atts;
    bool validName = false;
    bool firstNameSet = false;
    std::string firstName;
    int nSets = 1;
    avtSILRestriction_p silr = plot->GetSILRestriction();
    avtSILSet_p current = silr->GetSILSet(silr->GetTopSet());
    const std::vector<int> &mapsOut = current->GetMapsOut();
631
    for(size_t j = 0; j < mapsOut.size() && !validName; ++j)
632 633 634 635 636
    {
        int cIndex = mapsOut[j];
        avtSILCollection_p collection = silr->GetSILCollection(cIndex);
        if(*collection != NULL && collection->GetRole() == SIL_DOMAIN) 
        {
637
            nSets = collection->GetNumberOfSubsets(); 
bonnell's avatar
bonnell committed
638
            for(int si = 0; si < nSets && !validName; ++si)
639 640 641
            {
                if(!firstNameSet)
                {
642
                    firstName = silr->GetSILSet(collection->GetSubset(si))->GetName();
643 644
                    firstNameSet = true;
                }
645
                validName = (silr->GetSILSet(collection->GetSubset(si))->GetName() == 
646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673
                             sAtts->GetSubsetName());
            }
            break;
        }
    }

    // If the subset name is not valid then override it. Set it in the
    // default attributes so the GUI window does not get too confused when
    // the default attributes get sent to the client as when a plot of another
    // type is selected.
    if(!validName)
    {
        if(nSets > 1)
        {
            if(firstNameSet)
            {
                sAtts->SetSubsetName(firstName);
                defaultAtts->SetSubsetName(firstName);
            }
        }
        else
        {
            sAtts->SetSubsetName("Whole");
            defaultAtts->SetSubsetName("Whole");
        }
    }
}

whitlocb's avatar
whitlocb committed
674
Function: SpreadsheetViewerPluginInfo::Permits2DViewScaling
675 676 677 678 679 680 681
Declaration: virtual bool Permits2DViewScaling() const;
Definition:
bool
SpreadsheetViewerPluginInfo::Permits2DViewScaling() const
{
    return false;
}
whitlocb's avatar
whitlocb committed
682

683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734
Target: xml2atts
Function: ProcessOldVersions
Declaration: virtual void ProcessOldVersions(DataNode *parentNode, const char *configVersion);
Definition:
// ****************************************************************************
// Method: SpreadsheetAttributes::ProcessOldVersions
//
// Purpose:
//   This method handles some old fields by converting them to new fields.
//
// Programmer: Burlen Loring
// Creation:   Fri Jul 18 15:20:59 PDT 2014
//
// Modifications:
//
// ****************************************************************************
void
SpreadsheetAttributes::ProcessOldVersions(DataNode *parentNode,
    const char *configVersion)
{
    if(parentNode == 0)
        return;

    DataNode *searchNode = parentNode->GetNode("SpreadsheetAttributes");
    if(searchNode == 0)
        return;

    // deal with the changes in r7405 where type of currentPick was
    // changed from double[3] to int. Since that patch pick related
    // attributes are no longer recorded in session files so we will
    // need to ignore them here.
    if(VersionLessThan(configVersion, "2.0.0"))
    {
        const char *pickAtts[] = {
            "currentPick",
            "currentPickType",
            "currentPickValid",
            "currentPickLetter",
            "pastPicks",
            "pastPickLetters"
            };
        for (size_t i=0; i<6; ++i)
        {
            DataNode *pickAtt = searchNode->GetNode(pickAtts[i]);
            if (pickAtt)
            {
                searchNode->RemoveNode(pickAtt, true);
            }
        }
    }
}