vtkAxis.h 22.9 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
/*=========================================================================

  Program:   Visualization Toolkit
  Module:    vtkAxis.h

  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/

// .NAME vtkAxis - takes care of drawing 2D axes
//
// .SECTION Description
// The vtkAxis is drawn in screen coordinates. It is usually one of the last
// elements of a chart to be drawn. It renders the axis label, tick marks and
// tick labels.
David Thompson's avatar
David Thompson committed
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
// The tick marks and labels span the range of values between
// \a Minimum and \a Maximum.
// The \a Minimum and \a Maximum values are not allowed to extend beyond the
// \a MinimumLimit and \a MaximumLimit values, respectively.
//
// Note that many other chart elements (e.g., vtkPlotPoints) refer to
// vtkAxis instances to determine how to scale raw data for presentation.
// In particular, care must be taken with logarithmic scaling.
// The axis Minimum, Maximum, and Limit values are stored both unscaled
// and scaled (with log(x) applied when GetLogScaleActive() returns true).
// User interfaces will most likely present the unscaled values as they
// represent the values provided by the user.
// Other chart elements may need the scaled values in order to draw
// in the same coordinate system.
//
// Just because LogScale is set to true does not guarantee that the axis
// will use logarithmic scaling -- the Minimum and Maximum values for the
// axis must both lie to the same side of origin (and not include the origin).
// Also, this switch from linear- to log-scaling may occur during a rendering
// pass if autoscaling is enabled.
// Because the log and pow functions are not invertible and the axis itself
// decides when to switch between them without offering any external class
// managing the axis a chance to save the old values, it saves
// old Limit values in NonLogUnscaled{Min,Max}Limit so that behavior is
// consistent when LogScale is changed from false to true and back again.
47

48 49
#ifndef vtkAxis_h
#define vtkAxis_h
50

51
#include "vtkChartsCoreModule.h" // For export macro
52
#include "vtkContextItem.h"
53
#include "vtkSmartPointer.h" // For vtkSmartPointer
54
#include "vtkVector.h"       // For position variables
55
#include "vtkRect.h"         // For bounding rect
56
#include "vtkStdString.h"    // For vtkStdString ivars
57 58

class vtkContext2D;
59
class vtkPen;
60
class vtkFloatArray;
61
class vtkDoubleArray;
62
class vtkStringArray;
63
class vtkTextProperty;
64

65
class VTKCHARTSCORE_EXPORT vtkAxis : public vtkContextItem
66 67
{
public:
68
  vtkTypeMacro(vtkAxis, vtkContextItem);
69 70
  virtual void PrintSelf(ostream &os, vtkIndent indent);

71 72 73
  // Description:
  // Enumeration of the axis locations in a conventional XY chart. Other
  // layouts are possible.
74
  enum Location {
75 76 77
    LEFT = 0,
    BOTTOM,
    RIGHT,
Marcus Hanwell's avatar
Marcus Hanwell committed
78 79
    TOP,
    PARALLEL
80 81
  };

82 83
  enum {
    TICK_SIMPLE = 0,
84
    TICK_WILKINSON_EXTENDED
85 86
  };

87 88 89 90
  // Description:
  // Creates a 2D Chart object.
  static vtkAxis *New();

91
  // Description:
92
  // Get/set the position of the axis (LEFT, BOTTOM, RIGHT, TOP, PARALLEL).
93
  virtual void SetPosition(int position);
94 95
  vtkGetMacro(Position, int);

96 97
  // Description:
  // Set point 1 of the axis (in pixels), this is usually the origin.
98
  void SetPoint1(const vtkVector2f& pos);
99
  void SetPoint1(float x, float y);
100 101 102 103

  // Description:
  // Get point 1 of the axis (in pixels), this is usually the origin.
  vtkGetVector2Macro(Point1, float);
104
  vtkVector2f GetPosition1();
105 106 107

  // Description:
  // Set point 2 of the axis (in pixels), this is usually the terminus.
108
  void SetPoint2(const vtkVector2f& pos);
109
  void SetPoint2(float x, float y);
110 111 112 113

  // Description:
  // Get point 2 of the axis (in pixels), this is usually the terminus.
  vtkGetVector2Macro(Point2, float);
114
  vtkVector2f GetPosition2();
115 116

  // Description:
117 118
  // Set the number of tick marks for this axis. Default is -1, which leads to
  // automatic calculation of nicely spaced tick marks.
119
  virtual void SetNumberOfTicks(int numberOfTicks);
120 121 122 123 124

  // Description:
  // Get the number of tick marks for this axis.
  vtkGetMacro(NumberOfTicks, int);

125
  // Description:
126 127 128
  // Get the vtkTextProperty that governs how the axis lables are displayed.
  // Note that the alignment properties are not used.
  vtkGetObjectMacro(LabelProperties, vtkTextProperty);
129

130 131
  // Description:
  // Set the logical minimum value of the axis, in plot coordinates.
David Thompson's avatar
David Thompson committed
132 133
  // If LogScaleActive is true (not just LogScale), then this
  // sets the minimum base-10 <b>exponent</b>.
134
  virtual void SetMinimum(double minimum);
135 136 137

  // Description:
  // Get the logical minimum value of the axis, in plot coordinates.
David Thompson's avatar
David Thompson committed
138 139
  // If LogScaleActive is true (not just LogScale), then this
  // returns the minimum base-10 <b>exponent</b>.
140
  vtkGetMacro(Minimum, double);
141 142 143

  // Description:
  // Set the logical maximum value of the axis, in plot coordinates.
David Thompson's avatar
David Thompson committed
144 145
  // If LogScaleActive is true (not just LogScale), then this
  // sets the maximum base-10 <b>exponent</b>.
146
  virtual void SetMaximum(double maximum);
147 148 149

  // Description:
  // Get the logical maximum value of the axis, in plot coordinates.
David Thompson's avatar
David Thompson committed
150 151
  // If LogScaleActive is true (not just LogScale), then this
  // returns the maximum base-10 <b>exponent</b>.
152
  vtkGetMacro(Maximum, double);
153

David Thompson's avatar
David Thompson committed
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
  // Description:
  // Set the logical, unscaled minimum value of the axis, in plot coordinates.
  // Use this instead of SetMinimum() if you wish to provide the actual minimum
  // instead of log10(the minimum) as part of the axis scale.
  virtual void SetUnscaledMinimum(double minimum);

  // Description:
  // Get the logical minimum value of the axis, in plot coordinates.
  vtkGetMacro(UnscaledMinimum, double);

  // Description:
  // Set the logical maximum value of the axis, in plot coordinates.
  virtual void SetUnscaledMaximum(double maximum);

  // Description:
  // Get the logical maximum value of the axis, in plot coordinates.
  vtkGetMacro(UnscaledMaximum, double);

172
  // Description:
173
  // Set the logical range of the axis, in plot coordinates.
David Thompson's avatar
David Thompson committed
174 175 176 177 178 179
  //
  // The unscaled range will always be in the same coordinate system of
  // the data being plotted, regardless of whether LogScale is true or false.
  // When calling SetRange() and LogScale is true, the range must be specified
  // in logarithmic coordinates.
  // Using SetUnscaledRange(), you may ignore the value of LogScale.
180
  virtual void SetRange(double minimum, double maximum);
181
  virtual void SetRange(double range[2]);
David Thompson's avatar
David Thompson committed
182 183
  virtual void SetUnscaledRange(double minimum, double maximum);
  virtual void SetUnscaledRange(double range[2]);
184 185 186

  // Description:
  // Get the logical range of the axis, in plot coordinates.
David Thompson's avatar
David Thompson committed
187 188 189 190
  //
  // The unscaled range will always be in the same coordinate system of
  // the data being plotted, regardless of whether LogScale is true or false.
  // Calling GetRange() when LogScale is true will return the log10({min, max}).
191
  virtual void GetRange(double *range);
David Thompson's avatar
David Thompson committed
192
  virtual void GetUnscaledRange(double *range);
193

194 195
  // Description:
  // Set the logical lowest possible value for \a Minimum, in plot coordinates.
196
  virtual void SetMinimumLimit(double lowest);
197 198 199

  // Description:
  // Get the logical lowest possible value for \a Minimum, in plot coordinates.
200
  vtkGetMacro(MinimumLimit, double);
201 202 203

  // Description:
  // Set the logical highest possible value for \a Maximum, in plot coordinates.
204
  virtual void SetMaximumLimit(double highest);
205 206 207

  // Description:
  // Get the logical highest possible value for \a Maximum, in plot coordinates.
208
  vtkGetMacro(MaximumLimit, double);
209

David Thompson's avatar
David Thompson committed
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225
  // Description:
  // Set the logical lowest possible value for \a Minimum, in plot coordinates.
  virtual void SetUnscaledMinimumLimit(double lowest);

  // Description:
  // Get the logical lowest possible value for \a Minimum, in plot coordinates.
  vtkGetMacro(UnscaledMinimumLimit, double);

  // Description:
  // Set the logical highest possible value for \a Maximum, in plot coordinates.
  virtual void SetUnscaledMaximumLimit(double highest);

  // Description:
  // Get the logical highest possible value for \a Maximum, in plot coordinates.
  vtkGetMacro(UnscaledMaximumLimit, double);

Julien Finet's avatar
Julien Finet committed
226 227 228 229 230 231 232 233
  // Description:
  // Get the margins of the axis, in pixels.
  vtkGetVector2Macro(Margins, int);

  // Description:
  // Set the margins of the axis, in pixels.
  vtkSetVector2Macro(Margins, int);

234
  // Description:
235
  // Get/set the title text of the axis.
236 237
  virtual void SetTitle(const vtkStdString &title);
  virtual vtkStdString GetTitle();
238

239 240 241 242
  // Description:
  // Get the vtkTextProperty that governs how the axis title is displayed.
  vtkGetObjectMacro(TitleProperties, vtkTextProperty);

243
  // Description:
David Thompson's avatar
David Thompson committed
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260
  // Get whether the axis is using a log scale.
  // This will always be false when LogScale is false.
  // It is only true when LogScale is true <b>and</b> the \a UnscaledRange
  // does not cross or include the origin (zero).
  //
  // The limits (\a MinimumLimit, \a MaximumLimit, and their
  // unscaled counterparts) do not prevent LogScaleActive from becoming
  // true; they are adjusted if they cross or include the origin
  // and the original limits are preserved for when LogScaleActive
  // becomes false again.
  vtkGetMacro(LogScaleActive, bool);

  // Description:
  // Get/set whether the axis should <b>attempt</b> to use a log scale.
  //
  // The default is false.
  // \sa{LogScaleActive}.
261
  vtkGetMacro(LogScale, bool);
David Thompson's avatar
David Thompson committed
262 263
  virtual void SetLogScale(bool logScale);
  vtkBooleanMacro(LogScale,bool);
264 265 266

  // Description:
  // Get/set whether the axis grid lines should be drawn, default is true.
267 268
  vtkSetMacro(GridVisible, bool);
  vtkGetMacro(GridVisible, bool);
269

270 271 272 273 274
  // Description:
  // Get/set whether the axis labels should be visible.
  vtkSetMacro(LabelsVisible, bool);
  vtkGetMacro(LabelsVisible, bool);

275 276 277 278 279
  // Description:
  // Get/set whether the labels for the range should be visible.
  vtkSetMacro(RangeLabelsVisible, bool);
  vtkGetMacro(RangeLabelsVisible, bool);

280 281 282 283 284
  // Description:
  // Get/set the offset (in pixels) of the label text position from the axis
  vtkSetMacro(LabelOffset, float);
  vtkGetMacro(LabelOffset, float);

285 286 287 288 289
  // Description:
  // Get/set whether the tick marks should be visible.
  vtkSetMacro(TicksVisible, bool);
  vtkGetMacro(TicksVisible, bool);

290 291 292 293 294
  // Description:
  // Get/set whether the axis line should be visible.
  vtkSetMacro(AxisVisible, bool);
  vtkGetMacro(AxisVisible, bool);

295
  // Description:
296 297
  // Get/set the numerical precision to use, default is 2. This is ignored
  // when Notation is STANDARD_NOTATION or PRINTF_NOTATION.
298
  virtual void SetPrecision(int precision);
299 300
  vtkGetMacro(Precision, int);

301 302 303
  // Description:
  // Enumeration of the axis notations available.
  enum {
Kyle Lutz's avatar
Kyle Lutz committed
304 305 306
    STANDARD_NOTATION = 0,
    SCIENTIFIC_NOTATION,
    FIXED_NOTATION,
307
    PRINTF_NOTATION
308 309
  };

310
  // Description:
311 312 313
  // Get/Set the printf-style format string used when TickLabelAlgorithm is
  // TICK_SIMPLE and Notation is PRINTF_NOTATION. The default is "%g".
  virtual void SetLabelFormat(const std::string &fmt);
314 315 316 317 318 319 320 321
  vtkGetMacro(LabelFormat, std::string);

  // Description:
  // Get/Set the printf-style format string used for range labels.
  // This format is always used regardless of TickLabelAlgorithm and
  // Notation. Default is "%g".
  vtkSetMacro(RangeLabelFormat, std::string);
  vtkGetMacro(RangeLabelFormat, std::string);
322 323 324 325 326

  // Description:
  // Get/set the numerical notation, standard, scientific, fixed, or a
  // printf-style format string.
  // \sa SetPrecision SetLabelFormat
327
  virtual void SetNotation(int notation);
328 329
  vtkGetMacro(Notation, int);

330 331 332
  // Description:
  // Enumeration of the axis behaviors.
  enum {
333 334 335
    AUTO = 0, // Automatically scale the axis to view all data that is visible.
    FIXED,    // Use a fixed axis range and make no attempt to rescale.
    CUSTOM    // Deprecated, use the tick label settings instead.
336 337
  };

338
  // Description:
339
  // Get/set the behavior of the axis (auto or fixed). The default is 0 (auto).
340 341 342 343 344 345 346 347 348 349 350
  vtkSetMacro(Behavior, int);
  vtkGetMacro(Behavior, int);

  // Description:
  // Get a pointer to the vtkPen object that controls the way this axis is drawn.
  vtkGetObjectMacro(Pen, vtkPen);

  // Description:
  // Get a pointer to the vtkPen object that controls the way this axis is drawn.
  vtkGetObjectMacro(GridPen, vtkPen);

351 352 353 354 355 356 357 358 359
  // Description:
  // Get/set the tick label algorithm that is used to calculate the min, max
  // and tick spacing. There are currently two algoriths, vtkAxis::TICK_SIMPLE
  // is the default and uses a simple algorithm. The second option is
  // vtkAxis::TICK_WILKINSON which uses an extended Wilkinson algorithm to find
  // the optimal range, spacing and font parameters.
  vtkSetMacro(TickLabelAlgorithm, int)
  vtkGetMacro(TickLabelAlgorithm, int)

360 361 362 363 364
  // Description:
  // Get/set the scaling factor used for the axis, this defaults to 1.0 (no
  // scaling), and is used to coordinate scaling with the plots, charts, etc.
  vtkSetMacro(ScalingFactor, double)
  vtkGetMacro(ScalingFactor, double)
365 366
  vtkSetMacro(Shift, double)
  vtkGetMacro(Shift, double)
367

368 369 370 371 372
  // Description:
  // Update the geometry of the axis. Takes care of setting up the tick mark
  // locations etc. Should be called by the scene before rendering.
  virtual void Update();

373 374 375 376
  // Description:
  // Paint event for the axis, called whenever the axis needs to be drawn.
  virtual bool Paint(vtkContext2D *painter);

377 378 379 380 381 382 383
  // Description:
  // Use this function to autoscale the axes after setting the minimum and
  // maximum values. This will cause the axes to select the nicest numbers
  // that enclose the minimum and maximum values, and to select an appropriate
  // number of tick marks.
  virtual void AutoScale();

384 385 386 387 388
  // Description:
  // Recalculate the spacing of the tick marks - typically useful to do after
  // scaling the axis.
  virtual void RecalculateTickSpacing();

389
  // Description:
390 391 392 393 394 395 396 397 398 399 400 401 402
  // An array with the positions of the tick marks along the axis line.
  // The positions are specified in the plot coordinates of the axis.
  virtual vtkDoubleArray* GetTickPositions();

  // Description:
  // An array with the positions of the tick marks along the axis line.
  // The positions are specified in scene coordinates.
  virtual vtkFloatArray* GetTickScenePositions();

  // Description:
  // A string array containing the tick labels for the axis.
  virtual vtkStringArray* GetTickLabels();

403 404 405 406 407 408 409 410 411
  // Description:
  // Set the tick positions, and optionally custom tick labels. If the labels
  // and positions are null then automatic tick labels will be assigned. If
  // only positions are supplied then appropriate labels will be generated
  // according to the axis settings. If positions and labels are supplied they
  // must be of the same length. Returns true on success, false on failure.
  virtual bool SetCustomTickPositions(vtkDoubleArray* positions,
                                      vtkStringArray* labels = 0);

412 413
  // Description:
  // Request the space the axes require to be drawn. This is returned as a
414
  // vtkRectf, with the corner being the offset from Point1, and the width/
415 416 417 418
  // height being the total width/height required by the axis. In order to
  // ensure the numbers are correct, Update() should be called on the axis.
  vtkRectf GetBoundingRect(vtkContext2D* painter);

419 420 421 422 423 424
  // Description:
  // Return a "nice number", often defined as 1, 2 or 5. If roundUp is true then
  // the nice number will be rounded up, false it is rounded down. The supplied
  // number should be between 0.0 and 9.9.
  static double NiceNumber(double number, bool roundUp);

Zack Galbreath's avatar
Zack Galbreath committed
425 426 427 428 429 430
  // Description:
  // Static function to calculate "nice" minimum, maximum, and tick spacing
  // values.
  static double NiceMinMax(double &min, double &max, float pixelRange,
                           float tickPixelSpacing);

431 432 433 434 435
  // Description:
  // Generate a single label using the current settings when TickLabelAlgorithm
  // is TICK_SIMPLE.
  vtkStdString GenerateSimpleLabel(double val);

436 437 438 439
protected:
  vtkAxis();
  ~vtkAxis();

David Thompson's avatar
David Thompson committed
440 441 442 443 444 445 446 447 448
  // Description:
  // Update whether log scaling will be used for layout and rendering.
  //
  // Log scaling is only active when LogScaling is true <b>and</b> the closed,
  // unscaled range does not contain the origin.
  // The boolean parameter determines whether the minimum and maximum values
  // are set from their unscaled counterparts.
  void UpdateLogScaleActive(bool updateMinMaxFromUnscaled);

449 450 451 452
  // Description:
  // Calculate and assign nice labels/logical label positions.
  void GenerateTickLabels(double min, double max);

453 454 455 456
  // Description:
  // Generate tick labels from the supplied double array of tick positions.
  void GenerateTickLabels();

457 458
  void GenerateLabelFormat(int notation, double n);

459 460 461 462
  // Description:
  // Generate label using a printf-style format string.
  vtkStdString GenerateSprintfLabel(double value, const std::string & format);

463 464
  // Description:
  // Calculate the next "nicest" numbers above and below the current minimum.
465
  // \return the "nice" spacing of the numbers.
466
  double CalculateNiceMinMax(double &min, double &max);
467

468 469 470 471 472 473 474 475 476 477
  // Description:
  // Return a tick mark for a logarithmic axis.
  // If roundUp is true then the upper tick mark is returned.
  // Otherwise the lower tick mark is returned.
  // Tick marks will be: ... 0.1 0.2 .. 0.9 1 2 .. 9 10 20 .. 90 100 ...
  // Parameter nicevalue will be set to true if tick mark is in:
  // ... 0.1 0.2 0.5 1 2 5 10 20 50 100 ...
  // Parameter order is set to the detected order of magnitude of the number.
  double LogScaleTickMark(double number,
                          bool roundUp,
478
                          bool &niceValue,
479 480
                          int &order);

David Thompson's avatar
David Thompson committed
481 482 483 484 485 486 487 488 489 490 491 492
  // Description:
  // Generate logarithmically-spaced tick marks with linear-style labels.
  //
  // This is for the case when log scaling is active, but the axis min and max
  // span less than an order of magnitude.
  // In this case, the most significant digit that varies is identified and
  // ticks generated for each value that digit may take on. If that results
  // in only 2 tick marks, the next-most-significant digit is varied.
  // If more than 20 tick marks would result, the stride for the varying digit
  // is increased.
  void GenerateLogSpacedLinearTicks(int order, double min, double max);

493 494 495 496 497 498 499 500 501 502 503 504
  // Description:
  // Generate tick marks for logarithmic scale for specific order of magnitude.
  // Mark generation is limited by parameters min and max.
  // Tick marks will be: ... 0.1 0.2 .. 0.9 1 2 .. 9 10 20 .. 90 100 ...
  // Tick labels will be: ... 0.1 0.2 0.5 1 2 5 10 20 50 100 ...
  // If Parameter detaillabels is disabled tick labels will be:
  // ... 0.1 1 10 100 ...
  // If min/max is not in between 1.0 and 9.0 defaults will be used.
  // If min and max do not differ 1 defaults will be used.
  void GenerateLogScaleTickMarks(int order,
                                 double min = 1.0,
                                 double max = 9.0,
505
                                 bool detailLabels = true);
506

507
  int Position;        // The position of the axis (LEFT, BOTTOM, RIGHT, TOP)
508 509 510
  float *Point1;       // The position of point 1 (usually the origin)
  float *Point2;       // The position of point 2 (usually the terminus)
  vtkVector2f Position1, Position2;
511
  double TickInterval; // Interval between tick marks in plot space
512
  int NumberOfTicks;   // The number of tick marks to draw
513
  vtkTextProperty* LabelProperties; // Text properties for the labels.
514 515
  double Minimum;      // Minimum value of the axis
  double Maximum;      // Maximum values of the axis
516 517
  double MinimumLimit; // Lowest possible value for Minimum
  double MaximumLimit; // Highest possible value for Maximum
David Thompson's avatar
David Thompson committed
518 519 520 521 522 523
  double UnscaledMinimum;      // UnscaledMinimum value of the axis
  double UnscaledMaximum;      // UnscaledMaximum values of the axis
  double UnscaledMinimumLimit; // Lowest possible value for UnscaledMinimum
  double UnscaledMaximumLimit; // Highest possible value for UnscaledMaximum
  double NonLogUnscaledMinLimit; // Saved UnscaledMinimumLimit (when !LogActive)
  double NonLogUnscaledMaxLimit; // Saved UnscaledMinimumLimit (when !LogActive)
Julien Finet's avatar
Julien Finet committed
524
  int Margins[2];      // Horizontal/vertical margins for the axis
525
  vtkStdString Title;  // The text label drawn on the axis
526
  vtkTextProperty* TitleProperties; // Text properties for the axis title
David Thompson's avatar
David Thompson committed
527 528
  bool LogScale;       // *Should* the axis use a log scale?
  bool LogScaleActive; // *Is* the axis using a log scale?
529
  bool GridVisible;    // Whether the grid for the axis should be drawn
530
  bool LabelsVisible;  // Should the axis labels be visible
531
  bool RangeLabelsVisible; // Should range labels be visible?
532
  float LabelOffset;   // Offset of label from the tick mark
533
  bool TicksVisible;   // Should the tick marks be visible.
534
  bool AxisVisible;    // Should the axis line be visible.
535 536
  int Precision;       // Numerical precision to use, defaults to 2.
  int Notation;        // The notation to use (standard, scientific, mixed)
537
  std::string LabelFormat; // The printf-style format string used for labels.
538
  std::string RangeLabelFormat; // The printf-style format string used for range labels.
539 540
  int Behavior;        // The behaviour of the axis (auto, fixed, custom).
  float MaxLabel[2];   // The widest/tallest axis label.
541 542
  bool TitleAppended;  // Track if the title is updated when the label formats
                       // are changed in the Extended Axis Labeling algorithm
543

544 545 546 547 548
  // Description:
  // Scaling factor used on this axis, this is used to accurately render very
  // small/large numbers accurately by converting the underlying range by the
  // scaling factor.
  double ScalingFactor;
549
  double Shift;
550

551 552 553 554
  // Description:
  // Are we using custom tick labels, or should the axis generate them?
  bool CustomTickLabels;

555 556 557 558 559 560 561
  // Description:
  // This object stores the vtkPen that controls how the axis is drawn.
  vtkPen* Pen;

  // Description:
  // This object stores the vtkPen that controls how the grid lines are drawn.
  vtkPen* GridPen;
562

563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580
  // Description:
  // Position of tick marks in screen coordinates
  vtkSmartPointer<vtkDoubleArray> TickPositions;

  // Description:
  // Position of tick marks in screen coordinates
  vtkSmartPointer<vtkFloatArray> TickScenePositions;

  // Description:
  // The labels for the tick marks
  vtkSmartPointer<vtkStringArray> TickLabels;

  // Description:
  // Hint as to whether a nice min/max was set, otherwise labels may not be
  // present at the top/bottom of the axis.
  bool UsingNiceMinMax;

  // Description:
581
  // Mark the tick labels as dirty when the min/max value is changed.
582
  bool TickMarksDirty;
583

584 585 586 587
  // Description:
  // Flag to indicate that the axis has been resized.
  bool Resized;

588 589 590 591
  // Description:
  // The algorithm being used to tick label placement.
  int TickLabelAlgorithm;

592 593 594 595
  // Description:
  // The point cache is marked dirty until it has been initialized.
  vtkTimeStamp BuildTime;

596
private:
597
  vtkAxis(const vtkAxis &) VTK_DELETE_FUNCTION;
598
  void operator=(const vtkAxis &) VTK_DELETE_FUNCTION;
599 600 601 602

  // Description:
  // Return true if the value is in range, false otherwise.
  bool InRange(double value);
603

604 605
};

606
#endif //vtkAxis_h