Back to index

salome-gui  6.5.0
Public Member Functions | Private Attributes
Plot2d_ScaleDraw Class Reference

#include <Plot2d_ViewFrame.h>

List of all members.

Public Member Functions

 Plot2d_ScaleDraw (char f= 'g', int prec=6)
 Plot2d_ScaleDraw (const QwtScaleDraw &scaleDraw, char f= 'g', int prec=6)
virtual QwtText label (double value) const
int precision () const

Private Attributes

char myFormat
int myPrecision

Detailed Description

Definition at line 377 of file Plot2d_ViewFrame.h.


Constructor & Destructor Documentation

Plot2d_ScaleDraw::Plot2d_ScaleDraw ( char  f = 'g',
int  prec = 6 
)

Definition at line 3846 of file Plot2d_ViewFrame.cxx.

  : QwtScaleDraw(),
    myFormat(f),
    myPrecision(prec)
{
  invalidateCache();
}
Plot2d_ScaleDraw::Plot2d_ScaleDraw ( const QwtScaleDraw &  scaleDraw,
char  f = 'g',
int  prec = 6 
)

Definition at line 3854 of file Plot2d_ViewFrame.cxx.

  : QwtScaleDraw(scaleDraw),
    myFormat(f),
    myPrecision(prec)
{
  invalidateCache();
}

Member Function Documentation

QwtText Plot2d_ScaleDraw::label ( double  value) const [virtual]

Definition at line 3862 of file Plot2d_ViewFrame.cxx.

{
  QwtScaleMap m = map();
  QString str1 = QwtScaleDraw::label( m.s1() ).text();
  QString str2 = QwtScaleDraw::label( m.s2() ).text();
  if ( str1 == str2 ) {
    double aDist = fabs(map().s2()-map().s1())/5;
    int precision = 0;
    while (aDist < 1 ) {
      precision++; 
      aDist *= 10.; 
    }
    if ( precision > 0 && value > 0 )
      return QLocale::system().toString( value,'f', precision );
  }

  return QwtScaleDraw::label( value );
}

Here is the call graph for this function:

int Plot2d_ScaleDraw::precision ( ) const [inline]

Definition at line 385 of file Plot2d_ViewFrame.h.

{ return myPrecision; }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 388 of file Plot2d_ViewFrame.h.

Definition at line 389 of file Plot2d_ViewFrame.h.


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