| 2633 | } |
| 2634 | |
| 2635 | void CatClassifData::ExchangeLabels(int from, int to) |
| 2636 | { |
| 2637 | |
| 2638 | if (from < 0 || to < 0 || from == to) |
| 2639 | return; |
| 2640 | |
| 2641 | int tms = categories.size(); |
| 2642 | |
| 2643 | for (int t = 0; t < tms; t++) { |
| 2644 | int sz = categories[t].cat_vec.size(); |
| 2645 | if( from > sz || to > sz) { |
| 2646 | return; |
| 2647 | } |
| 2648 | wxBrush from_brush = categories[t].cat_vec[from].brush; |
| 2649 | wxBrush to_brush = categories[t].cat_vec[to].brush; |
| 2650 | wxPen from_pen = categories[t].cat_vec[from].pen; |
| 2651 | wxPen to_pen = categories[t].cat_vec[to].pen; |
| 2652 | wxString from_lbl = categories[t].cat_vec[from].label; |
| 2653 | wxString to_lbl = categories[t].cat_vec[to].label; |
| 2654 | |
| 2655 | Category tmp = categories[t].cat_vec[from]; |
| 2656 | categories[t].cat_vec[from] = categories[t].cat_vec[to]; |
| 2657 | categories[t].cat_vec[to] = tmp; |
| 2658 | |
| 2659 | categories[t].cat_vec[from].brush = from_brush; |
| 2660 | categories[t].cat_vec[to].brush = to_brush; |
| 2661 | categories[t].cat_vec[from].pen = from_pen; |
| 2662 | categories[t].cat_vec[to].pen = to_pen; |
| 2663 | categories[t].cat_vec[from].label = from_lbl; |
| 2664 | categories[t].cat_vec[to].label = to_lbl; |
| 2665 | |
| 2666 | } |
| 2667 | } |
| 2668 | |
| 2669 | void CatClassifData::AppendUndefCategory(int t, int count) |
| 2670 | { |