| 220 | } |
| 221 | |
| 222 | int vtkParallelCoordinatesView::SetAxisHighlightPosition( |
| 223 | vtkParallelCoordinatesRepresentation* rep, int position) |
| 224 | { |
| 225 | int numAxes = rep->GetNumberOfAxes(); |
| 226 | |
| 227 | if (numAxes <= 0) |
| 228 | return -1; |
| 229 | |
| 230 | double p1[2], p2[2]; |
| 231 | rep->GetPositionAndSize(p1, p2); |
| 232 | double xpos = rep->GetXCoordinateOfPosition(position); |
| 233 | |
| 234 | if (xpos < 0 || position < 0 || position >= numAxes) |
| 235 | { |
| 236 | this->HighlightSource->SetBounds(-1, -1, -1, -1, -1, -1); |
| 237 | this->HighlightActor->VisibilityOff(); |
| 238 | return -1; |
| 239 | } |
| 240 | else |
| 241 | { |
| 242 | double xmargin = .3 * p2[0] / static_cast<double>(numAxes); |
| 243 | double ymargin = .05 * p2[1]; |
| 244 | if (this->AxisHighlightPosition == VTK_HIGHLIGHT_CENTER) |
| 245 | { |
| 246 | this->HighlightSource->SetBounds( |
| 247 | xpos - xmargin, xpos + xmargin, p1[1] + ymargin, p1[1] + p2[1] - ymargin, 0, 0); |
| 248 | } |
| 249 | else if (this->AxisHighlightPosition == VTK_HIGHLIGHT_MIN) |
| 250 | { |
| 251 | this->HighlightSource->SetBounds( |
| 252 | xpos - xmargin, xpos + xmargin, p1[1] - ymargin, p1[1] + ymargin, 0, 0); |
| 253 | } |
| 254 | else if (this->AxisHighlightPosition == VTK_HIGHLIGHT_MAX) |
| 255 | { |
| 256 | this->HighlightSource->SetBounds( |
| 257 | xpos - xmargin, xpos + xmargin, p1[1] + p2[1] - ymargin, p1[1] + p2[1] + ymargin, 0, 0); |
| 258 | } |
| 259 | this->HighlightSource->Update(); |
| 260 | this->HighlightActor->VisibilityOn(); |
| 261 | } |
| 262 | |
| 263 | return position; |
| 264 | } |
| 265 | |
| 266 | int vtkParallelCoordinatesView::SetAxisHighlightPosition( |
| 267 | vtkParallelCoordinatesRepresentation* rep, double position) |
no test coverage detected