MCPcopy Create free account
hub / github.com/Kitware/VTK / StackAbove

Method StackAbove

Rendering/Context2D/vtkAbstractContextItem.cxx:119–153  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

117
118//------------------------------------------------------------------------------
119vtkIdType 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//------------------------------------------------------------------------------
156vtkIdType vtkAbstractContextItem::Lower(vtkIdType index)

Callers 4

RaiseMethod · 0.95
StackUnderMethod · 0.95
StackPlotAboveMethod · 0.80
TestContextItemStackingFunction · 0.80

Calls 2

rotateFunction · 0.50
beginMethod · 0.45

Tested by 1

TestContextItemStackingFunction · 0.64