------------------------------------------------------------------------------
| 117 | |
| 118 | //------------------------------------------------------------------------------ |
| 119 | vtkIdType vtkAbstractContextItem::StackAbove(vtkIdType index, vtkIdType under) |
| 120 | { |
| 121 | vtkIdType res = index; |
| 122 | if (index == under || index < 0) |
| 123 | { |
| 124 | return res; |
| 125 | } |
| 126 | vtkIdType start = 0; |
| 127 | vtkIdType middle = 0; |
| 128 | vtkIdType end = 0; |
| 129 | if (under == -1) |
| 130 | { |
| 131 | start = 0; |
| 132 | middle = index; |
| 133 | end = index + 1; |
| 134 | res = 0; |
| 135 | } |
| 136 | else if (index > under) |
| 137 | { |
| 138 | start = under + 1; |
| 139 | middle = index; |
| 140 | end = index + 1; |
| 141 | res = start; |
| 142 | } |
| 143 | else // if (index < under) |
| 144 | { |
| 145 | start = index; |
| 146 | middle = index + 1; |
| 147 | end = under + 1; |
| 148 | res = end - 1; |
| 149 | } |
| 150 | std::rotate(this->Children->begin() + start, this->Children->begin() + middle, |
| 151 | this->Children->begin() + end); |
| 152 | return res; |
| 153 | } |
| 154 | |
| 155 | //------------------------------------------------------------------------------ |
| 156 | vtkIdType vtkAbstractContextItem::Lower(vtkIdType index) |