----------------------------------------------------------------------------- Perform some initialization, determine which Axis type we are -----------------------------------------------------------------------------
| 318 | // Perform some initialization, determine which Axis type we are |
| 319 | //-----------------------------------------------------------------------------* |
| 320 | void vtkAxisActor::BuildAxis(vtkViewport* viewport, bool force) |
| 321 | { |
| 322 | // We'll do our computation in world coordinates. First determine the |
| 323 | // location of the endpoints. |
| 324 | double *x, p1[3], p2[3]; |
| 325 | x = this->Point1Coordinate->GetValue(); |
| 326 | p1[0] = x[0]; |
| 327 | p1[1] = x[1]; |
| 328 | p1[2] = x[2]; |
| 329 | x = this->Point2Coordinate->GetValue(); |
| 330 | p2[0] = x[0]; |
| 331 | p2[1] = x[1]; |
| 332 | p2[2] = x[2]; |
| 333 | |
| 334 | // |
| 335 | // Test for axis of zero length. |
| 336 | // |
| 337 | if (p1[0] == p2[0] && p1[1] == p2[1] && p1[2] == p2[2]) |
| 338 | { |
| 339 | vtkDebugMacro(<< "Axis has zero length, not building."); |
| 340 | this->AxisHasZeroLength = true; |
| 341 | return; |
| 342 | } |
| 343 | this->AxisHasZeroLength = false; |
| 344 | |
| 345 | if (!force && this->GetMTime() < this->BuildTime.GetMTime() && |
| 346 | viewport->GetMTime() < this->BuildTime.GetMTime()) |
| 347 | { |
| 348 | return; // already built |
| 349 | } |
| 350 | |
| 351 | if (this->Log) |
| 352 | { |
| 353 | if (this->Range[0] <= 0.0) |
| 354 | { |
| 355 | vtkWarningMacro(<< "Range value undefined for log scale enabled. " |
| 356 | << "Current Range: (" << this->Range[0] << ", " << this->Range[1] << ")" |
| 357 | << "Range[0] must be > 0.0. " |
| 358 | << "."); |
| 359 | return; |
| 360 | } |
| 361 | if (this->MinorRangeStart <= 0.0 || this->MajorRangeStart <= 0.0) |
| 362 | { |
| 363 | vtkWarningMacro( |
| 364 | << "MinorRangeStart value or MajorRangeStart value undefined for log scale enabled" |
| 365 | << "MinorRangeStart: " << this->MinorRangeStart |
| 366 | << ", MajorRangeStart: " << this->MajorRangeStart << ". " |
| 367 | << "MinorRangeStart and MajorRangeStart must be > 0.0. " |
| 368 | << "."); |
| 369 | return; |
| 370 | } |
| 371 | } |
| 372 | |
| 373 | vtkDebugMacro(<< "Rebuilding axis"); |
| 374 | |
| 375 | if (force || this->GetProperty()->GetMTime() > this->BuildTime.GetMTime()) |
| 376 | { |
| 377 | this->UpdateTitleActorProperty(); |
no test coverage detected