Scale Class Reference

#include <qwt3d_scale.h>

Inheritance diagram for Scale:

LinearScale LogScale

List of all members.

Protected Member Functions

virtual QString ticLabel (unsigned int idx) const
virtual void setLimits (double start, double stop)
virtual void setMajors (int val)
virtual void setMinors (int val)
virtual void setMajorLimits (double start, double stop)
int majors () const
int minors () const
virtual Scaleclone () const =0
virtual void calculate ()=0
virtual int autoscale (double &a, double &b, double start, double stop, int ivals)

Protected Attributes

std::vector< double > majors_p
std::vector< double > minors_p
double start_p
double stop_p
int majorintervals_p
int minorintervals_p
double mstart_p
double mstop_p

Detailed Description

The class encapsulates non-visual scales. She is utilized by Axis and also collaborates closely with AutoScaler. A Scale allows control over all aspects of tic generation including arbitrary transformations of tic values into corresponding strings. The strings contain what eventually will be shown as tic labels.
Standard linear and logarithmic scales have been integrated yet into the Axis interface. User-defined axes can be derived from Scale, LinearScale et al.

Member Function Documentation

QString ticLabel ( unsigned int  idx  )  const [protected, virtual]

The function maps the double value at tic-position idx to a final representation. The default return value is simply the tic values QString representation. Overwrite this function, if you plan to transform the value in some way. See e.g. LogScale::ticLabel.

idx the current major tic index
The QString representation for the value corresponding to a valid index, an empty QString else.

Reimplemented in LogScale.

void setLimits ( double  start,
double  stop 
) [protected, virtual]

Sets start and stop value for the scale;.

virtual void setMajors ( int  val  )  [inline, protected, virtual]

Sets number of major intervals.

virtual void setMinors ( int  val  )  [inline, protected, virtual]

Sets number of minor intervals per major interval.

Reimplemented in LogScale.

void setMajorLimits ( double  start,
double  stop 
) [protected, virtual]

Sets value of first major tic.

int majors (  )  const [inline, protected]

Returns major intervals.

int minors (  )  const [inline, protected]

Returns minor intervals.

virtual Scale* clone (  )  const [protected, pure virtual]

Derived classes should return a new heap based object here.

Implemented in LinearScale, and LogScale.

virtual void calculate (  )  [protected, pure virtual]

This function should setup the 2 vectors for major and minor positions;.

Implemented in LinearScale, and LogScale.

int autoscale ( double &  a,
double &  b,
double  start,
double  stop,
int  ivals 
) [protected, virtual]

a First major tic after applying autoscaling
b Last major tic after applying autoscaling
start Scale begin
stop Scale end
ivals Requested number of major intervals
Number of major intervals after autoscaling
The default implementation sets a=start, b=stop and returns ivals.

Reimplemented in LinearScale.

The documentation for this class was generated from the following files:

Generated on Sun Jun 7 00:16:33 2009 for QwtPlot3D API by  doxygen 1.5.8