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

QSContour Class Reference

Abstract base class for contour datasets. More...

#include <qscontour.h>

Inheritance diagram for QSContour:

Inheritance graph
[legend]
List of all members.

Public Types

enum  PointElement { PointMark = 0 }
enum  LineElement { Grid = 0 }

Public Methods

 QSContour (QSAxes *parent, const char *name=0)
virtual ~QSContour ()
void setContourFills (bool visible)
void setContourLines (bool visible)
void setContourLabels (bool visible)
void setLabelSpacing (double labelSpacing)
bool contourFills () const
bool contourLines () const
bool contourLabels () const
double labelSpacing () const
virtual QString posInfo (QSPt2f &pos)
virtual bool isClicked (const QSPt2f &pos)
virtual QSPt2f legendItemSize (QSDrv *drv)
virtual void drawLegendItem (const QSPt2f &pos, QSDrv *drv)
virtual void loadStateFromStream (QDataStream &stream, QSObjectFactory *factory)
virtual void saveStateToStream (QDataStream &stream, QSObjectFactory *factory)

Protected Methods

virtual void allocRuntimeData ()
virtual void freeRuntimeData ()
virtual bool start ()
virtual bool prepare ()
virtual bool step ()
virtual void end ()
virtual int triangles ()=0
virtual void getTriangle (int number, QSPt3f pts[3], double level=-10.0)=0
virtual bool getNeighbouringTriangle (int *number, int *edge)=0
virtual int triangleAtPos (const QSPt2f &pos)=0
virtual QString vertexInfo (int t, int v, QSPt2f &pos)=0
virtual void drawGrid ()=0
virtual void drawPoints ()=0
virtual bool rectangleGrid () const
virtual void getRectangle (int triangleNumber, QSPt3f pts[4])

Static Protected Attributes

const double EPS_VALUE

Detailed Description

Abstract base class for contour datasets.

Draws contours. It contains a pure virtual functions which must be reimplemented to get it to work.

Author:
Kamil Dobkowski


Member Enumeration Documentation

enum QSContour::LineElement
 

See QSGraphicalData::setLine()

enum QSContour::PointElement
 

See QSGraphicalData::setPoint()


Constructor & Destructor Documentation

QSContour::QSContour QSAxes   parent,
const char *    name = 0
 

Constructor.

virtual QSContour::~QSContour   [virtual]
 

Destructor.


Member Function Documentation

virtual void QSContour::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 from QSPlot.

Reimplemented in QSGriddedContour.

virtual void QSContour::drawGrid   [protected, pure virtual]
 

Draw grid ( lines connecting data points )

Implemented in QSGriddedContour.

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

Draw legend item at position 'pos'

Reimplemented from QSPlot.

virtual void QSContour::drawPoints   [protected, pure virtual]
 

Draw point marks

Implemented in QSGriddedContour.

virtual void QSContour::end   [protected, virtual]
 

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

Reimplemented from QSPlot.

virtual void QSContour::freeRuntimeData   [protected, virtual]
 

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

Reimplemented from QSPlot.

Reimplemented in QSGriddedContour.

virtual bool QSContour::getNeighbouringTriangle int *    number,
int *    edge
[protected, pure virtual]
 

Returns if there is a neighbouring triangle. In 'number' and 'edge' returns a neighbouring triangle and edge of triangle 'number' and edge 'edge'.

Implemented in QSGriddedContour.

virtual void QSContour::getRectangle int    triangleNumber,
QSPt3f    pts[4]
[inline, protected, virtual]
 

Reimplement this to return rectangle coordinates if the contour is drawn over rectangle grid. The rectangleGrid() method should be reimplemented too in this case. Rectangles are assumed be divided into four triangles. Rectangle 0 contains triangles 0-3, rectangle 1 contains triangles 4-7 etc ... The function id provided for efficiency only. Whole rectangles ( four triangles ) will be processed in a single step during drawing.

Reimplemented in QSGriddedContour.

virtual void QSContour::getTriangle int    number,
QSPt3f    pts[3],
double    level = -10.0
[protected, pure virtual]
 

Returns triangle number 'number'. The first edge is between pts[0] and pts[1] the second one is between pts[1] and pts[2] the third one is between pts[2] and pts[0] point z values must not be equal to level. If there is such point add EPS_VALUE to its z coordinate. see: getNeighboutingTriangle()

Implemented in QSGriddedContour.

virtual QSPt2f QSContour::legendItemSize QSDrv   drv [virtual]
 

Returns item size

Reimplemented from QSPlot.

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

Restores all graphics atributes

Reimplemented from QSPlot.

Reimplemented in QSGriddedContour.

virtual QString QSContour::posInfo QSPt2f   pos [virtual]
 

Returns info or QString::null

Reimplemented from QSPlot.

virtual bool QSContour::prepare   [inline, protected, virtual]
 

This will be called until it returns true and can be reimplemented for some in the background stuff.

Reimplemented in QSNonGriddedContour.

virtual bool QSContour::rectangleGrid   const [inline, protected, virtual]
 

Reimplement this to return true if the contour is drawn over rectangle grid. The getRectangle() method should be reimplemented too in this case. Rectangles are assumed be divided into four triangles. Rectangle 0 contains triangles 0-3, rectangle 1 contains triangles 4-7 etc ...

Reimplemented in QSGriddedContour.

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

Saves all graphics attributes

Reimplemented from QSPlot.

Reimplemented in QSGriddedContour.

virtual bool QSContour::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 from QSPlot.

virtual bool QSContour::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 from QSPlot.

virtual int QSContour::triangleAtPos const QSPt2f   pos [protected, pure virtual]
 

Returns a number of a triangle which contains the point 'pos' if any or -1. Used by 'isClicked' and 'posInfo' subroutines. Nothing really nessesary

Implemented in QSGriddedContour.

virtual int QSContour::triangles   [protected, pure virtual]
 

Returns a total number of triangles.

Implemented in QSGriddedContour.

virtual QString QSContour::vertexInfo int    t,
int    v,
QSPt2f   pos
[protected, pure virtual]
 

Returns info about the vertex 'v' of the triangle 't'. Nothing really nessesary

Implemented in QSGriddedContour.


Member Data Documentation

const double QSContour::EPS_VALUE [static, protected]
 

See getTriangle()


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