Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Examples  

QSPlot Class Reference

Dataset, which can be diplayed using QSAxes. More...

#include <qsplot.h>

Inheritance diagram for QSPlot:

Inheritance graph
[legend]
List of all members.

Public Methods

 QSPlot (QSAxes *parentAxes=0, const char *name=0)
virtual ~QSPlot ()
void setDefaultAxis (QSAxis *axis)
void setDefaultXAxis (int axisIndex)
void setDefaultYAxis (int axisIndex)
void setDefaultZAxis (int axisIndex)
void setDefaultVAxis (int axisIndex)
int defaultXAxis () const
int defaultYAxis () const
int defaultZAxis () const
int defaultVAxis () const
QSAxisdefaultAxis (int axisType) const
void setGradient (const QSGGradient &gradient)
const QSGGradient gradient () const
void setLegendItemVisible (bool visible)
bool legendItemVisible () const
virtual QString posInfo (QSPt2f &pos)
virtual QSPt2f legendItemSize (QSDrv *drv)
virtual void drawLegendItem (const QSPt2f &pos, QSDrv *drv)
QSPt2f dataToWorld (const QSPt2f &p) const
QSPt3f dataToWorld (const QSPt3f &p) const
QSPt3f dataToWorldV (const QSPt3f &p) const
QSPt2f worldToData (const QSPt2f &p) const
QSPt3f worldToData (const QSPt3f &p) const
QSPt3f worldToDataV (const QSPt3f &p) const
void setGradientProperty (const QString &string)
QString gradientProperty () const
virtual void loadStateFromStream (QDataStream &stream, QSObjectFactory *factory)
virtual void saveStateToStream (QDataStream &stream, QSObjectFactory *factory)

Protected Slots

virtual void axisRemoved (QSData *object)

Protected Methods

virtual bool getAxisRange (QSAxis *axis, double &min, double &max)
virtual bool start ()
virtual bool step ()
virtual void end ()
virtual void allocRuntimeData ()
virtual void freeRuntimeData ()

Protected Attributes

bool m_busy
bool m_is_legend
int m_bkg_handler
double m_curr_dpi
QSDrvm_drv
QSPt2f m_csize
QSPt2f m_cpos
QSAxism_daxes [5]
QSAxesm_axes
QSGGradient m_gradient
const QSProjectionm_proj

Static Protected Attributes

const int work_steps = 30

Detailed Description

Dataset, which can be diplayed using QSAxes.

Dataset, which can be diplayed using QSAxes, see QSAxes::plotAdd(). You can bind this dataset to some axes in the parent object using setDefaultAxis(). You can map coordinates from data to world coordinates using worldToData(). QSPlot contains support for drawing legends, see drawLegendItem(), legendItemSize(). QSCLegend uses them extensively. There is also support for 'Data picker' tool implemented, see posInfo(). For implementing your own dataset types you will have to reimplement : getAxisRange(), start(), step(), end(), and also drawLegendItem(), legendItemSize(), posInfo(), and optionaly allocRuntimeData(), freeRuntimeData().

Author:
Kamil Dobkowski


Constructor & Destructor Documentation

QSPlot::QSPlot QSAxes   parentAxes = 0,
const char *    name = 0
 

Constructor. You must add the plot immedialtely to the parent child list ( see QSAxes::plotAdd() )

virtual QSPlot::~QSPlot   [virtual]
 

Destructor.


Member Function Documentation

virtual void QSPlot::allocRuntimeData   [protected, virtual]
 

Called from start(). Everyting which goes to start() may be put here. inits m_curr_driver, m_curr_dpi, m_csize, m_cpos fields with values taken from parent axes

Reimplemented in QSContour.

virtual void QSPlot::axisRemoved QSData   object [protected, virtual, slot]
 

Check if this plot is not bound to a removed axis. if it is, find another axis of the same type - there always should be at least one such axis..

QSPt3f QSPlot::dataToWorld const QSPt3f   p const
 

Maps a point from an visible axis range to <0,1>

QSPt2f QSPlot::dataToWorld const QSPt2f   p const
 

Maps a point from an visible axis range to <0,1>

QSPt3f QSPlot::dataToWorldV const QSPt3f   p const
 

Maps a point from an visible axis range to <0,1>

QSAxis* QSPlot::defaultAxis int    axisType const [inline]
 

Returns default axis. 'axisType' must be one of QSAxes::AxisType' !

int QSPlot::defaultVAxis   const [inline]
 

Returns an index of the default axis

int QSPlot::defaultXAxis   const [inline]
 

Returns an index of the default axis

int QSPlot::defaultYAxis   const [inline]
 

Returns an index of the default axis

int QSPlot::defaultZAxis   const [inline]
 

Returns an index of the default axis

virtual void QSPlot::drawLegendItem const QSPt2f   pos,
QSDrv   drv
[virtual]
 

Draw legend item at position 'pos'

Reimplemented in QSContour.

virtual void QSPlot::end   [protected, virtual]
 

This can be called by parent axes to stop drawing. Normally called after 'step()' returned false;

Reimplemented in QSContour.

virtual void QSPlot::freeRuntimeData   [protected, virtual]
 

Called from end().Everyting which goes to end() may be put here.

Reimplemented in QSContour.

virtual bool QSPlot::getAxisRange QSAxis   axis,
double &    min,
double &    max
[protected, virtual]
 

Must be reimplemented and return data range on each axis or false when no data is set. This functions is always called outside 'start()' and 'end()' !

Reimplemented in QSGriddedContour.

const QSGGradient QSPlot::gradient   const [inline]
 

Returns a gradient

QString QSPlot::gradientProperty   const [inline]
 

Returns gradient as QString

virtual QSPt2f QSPlot::legendItemSize QSDrv   drv [virtual]
 

Returns item size

Reimplemented in QSContour.

bool QSPlot::legendItemVisible   const [inline]
 

Returns legend setting.

virtual void QSPlot::loadStateFromStream QDataStream &    stream,
QSObjectFactory   factory
[virtual]
 

Restores all graphics atributes

Reimplemented from QSGraphicalData.

Reimplemented in QSContour.

virtual QString QSPlot::posInfo QSPt2f   pos [virtual]
 

Returns info or QString::null

Reimplemented in QSContour.

virtual void QSPlot::saveStateToStream QDataStream &    stream,
QSObjectFactory   factory
[virtual]
 

Saves all graphics attributes

Reimplemented from QSGraphicalData.

Reimplemented in QSContour.

void QSPlot::setDefaultAxis QSAxis   axis
 

Sets an axis to which to bind to. Type of this axis is taken from QSAxis::type() .

void QSPlot::setDefaultVAxis int    axisIndex
 

Sets the default axis.

void QSPlot::setDefaultXAxis int    axisIndex
 

Sets the default axis.

void QSPlot::setDefaultYAxis int    axisIndex
 

Sets the default axis.

void QSPlot::setDefaultZAxis int    axisIndex
 

Sets the default axis.

void QSPlot::setGradient const QSGGradient   gradient
 

Sets a gradient object

void QSPlot::setGradientProperty const QString &    string
 

Sets a new gradient.

void QSPlot::setLegendItemVisible bool    visible
 

Show legend item corresponding to this plot in legend object

virtual bool QSPlot::start   [protected, virtual]
 

Start drawing. Called by parent axes. Time-expensive operations should be performed in little parts during 'step()' call. If returns false - 'end()' is called immediately, if returns true - 'step()' is called next.

Reimplemented in QSContour.

virtual bool QSPlot::step   [protected, virtual]
 

This function will be called to make drawing until it returns false. Notice that drawing should be stopped at any time. Even if this function returns true parent axes object may decide to call end().

Reimplemented in QSContour.

QSPt3f QSPlot::worldToData const QSPt3f   p const
 

Maps a point from <0,1> to an visible axis range

QSPt2f QSPlot::worldToData const QSPt2f   p const
 

Maps a point from <0,1> to an visible axis range.

QSPt3f QSPlot::worldToDataV const QSPt3f   p const
 

Maps a point from <0,1> to an visible axis range


The documentation for this class was generated from the following file:
Generated on Mon Mar 18 19:16:51 2002 for KMatplot library by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002