| 632 | |
| 633 | |
| 634 | int |
| 635 | FilePlotter::setCol(const ID &theCols) |
| 636 | { |
| 637 | if (theCols.Size()%2 != 0) { |
| 638 | opserr << "FilePlotter::setCol() - the size of the cols ID " << theCols.Size() << " is not a multiple of 2\n"; |
| 639 | return -1; |
| 640 | } |
| 641 | |
| 642 | for (int i=0; i<theCols.Size(); i++) { |
| 643 | if (theCols(i) < 1) { |
| 644 | opserr << "FilePlotter::FilePlotter() - a value of the cols " << theCols(i) << " is < 1\n"; |
| 645 | return -2; |
| 646 | } |
| 647 | } |
| 648 | // check colX is valid, i.e. >= 1 |
| 649 | // if valid set colX using c indexing |
| 650 | |
| 651 | if (cols != 0) { |
| 652 | if (cols->Size() != theCols.Size()) { |
| 653 | delete cols; |
| 654 | cols = 0; |
| 655 | } else |
| 656 | *cols = theCols; |
| 657 | } |
| 658 | |
| 659 | if (cols == 0) |
| 660 | cols = new ID(theCols); |
| 661 | |
| 662 | for (int j=0; j<cols->Size(); j++) |
| 663 | (*cols)(j) -= 1; |
| 664 | |
| 665 | return 0; |
| 666 | } |
| 667 | |
| 668 | |
| 669 |
no test coverage detected