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

QSCObject Class Reference

Base class for canvas objects which can be displayed on a page. More...

#include <qscobject.h>

Inheritance diagram for QSCObject:

Inheritance graph
[legend]
List of all members.

Public Types

enum  Style { Rotateable = 1U<<0, Resizeable = 1U<<1, Moveable = 1U<<2 }

Public Slots

virtual void parametersChanging ()
virtual void parametersChanged ()
virtual void forceUpdate ()

Signals

void sigDrawEnds (QSCObject *me)
void sigUpdate (QSCObject *me)
void sigUpdate ()

Public Methods

 QSCObject (QObject *parent=NULL)
virtual ~QSCObject ()
QSCGroupgroup () const
QSCObjectCollectioncollection () const
QSCObjectCollectionrootCollection ()
virtual void setParentAxes (QSAxes *axes)
QSAxesparentAxes () const
virtual int style ()
virtual void setAutoUpdates (bool enabled)
bool autoUpdates () const
virtual void raise ()
virtual void lower ()
virtual void toFront ()
virtual void toBack ()
virtual void reorder (int newPosition)
virtual void paintSkeleton (QPainter *p, double dpi=72.0)
virtual void paint (QPainter *p, double dpi=72.0, bool blocking=true, bool transparent=true)
virtual void draw (QSDrv *drv, bool blocking=true, bool transparent=true)=0
virtual bool busy () const
virtual void stop ()
virtual bool isHit (const QSPt2f &p, QSDrv *drv)
virtual void setBox (const QSRectf &canvas_rect, QSDrv *drv)
virtual QSRectf box (QSDrv *drv)
virtual void setAngle (int deg)
virtual int angle () const
virtual QSPt2f rCenter (QSDrv *drv)
virtual QString name ()
virtual bool isAxesShadow ()
void setDefaultAxis (QSAxis *axis)
QSAxisdefaultAxis (int axisType) const
QSPt3f mixedToCanvas (const QSPt3f &pos, int xCoordIn, int yCoordIn, int zCoordIn, double dpi)
QSPt3f canvasToMixed (const QSPt3f &pos, int xCoordOut, int yCoordOut, int zCoordOut, double dpi)
void setDefaultXAxis (int axisIndex)
void setDefaultYAxis (int axisIndex)
void setDefaultZAxis (int axisIndex)
int defaultXAxis () const
int defaultYAxis () const
int defaultZAxis () const
virtual void loadStateFromStream (QDataStream &stream, QSObjectFactory *factory)
virtual void saveStateToStream (QDataStream &stream, QSObjectFactory *factory)

Protected Methods

virtual void setCollection (QSCObjectCollection *collection)
virtual void setGroup (QSCGroup *group)

Protected Attributes

QSAxesm_parent_axes
QSAxism_default_axis [3]
bool m_auto_updates
QSCObjectCollectionm_collection
QSCGroupm_group

Detailed Description

Base class for canvas objects which can be displayed on a page.

It can paint itself using the given painter - see paint(). Sometimes it takes much time to draw some objects such as graphs with many datapoints, so it supports drawing in the background. See paint() ( 'blocking' argument ), busy(), stop(), sigDrawEnds() methods. QSCObject is usually a member of some object collection, see collection(). It can be the main object collection of QSPage, but it can be also QSCGroup collection if object is grouped with others. In this case group() method returns a pointer to this group. QSCObject can be bound to some QSAxes object - see setParentAxes(). It is useful when, for example, QSCArrow should point at some data point in your graph. You can transform coordinates between various coordinate systems using mixedToCanvas(), canvasToMixed(). Notice that a single QSAxes object can have many coordinate systems, defined by every set of its axes. So you can choose which axes you want to use - see setDefaultXAxis(), setDefaultYAxis(), setDefaultZAxis(). OQSCObject notifies when its parameters are changing, so it needs redrawing - see sigUpdate(). Use setBox() for positioning and resizing the object.

Author:
Kamil Dobkowski


Member Enumeration Documentation

enum QSCObject::Style
 

Style of this object.


Constructor & Destructor Documentation

QSCObject::QSCObject QObject *    parent = NULL
 

Constructor.

virtual QSCObject::~QSCObject   [virtual]
 

Destructor. Removes an object from a parent child list.


Member Function Documentation

virtual int QSCObject::angle   const [inline, virtual]
 

Returns the current angle

bool QSCObject::autoUpdates   const [inline]
 

Returns auto-update state

virtual QSRectf QSCObject::box QSDrv   drv [virtual]
 

Return a bounding box of the object. Result rect can be unnormalized ( size can be < 0 ) Drv is used to obtains size of text labels etc.

Reimplemented in QSCAxesShadow.

virtual bool QSCObject::busy   const [inline, virtual]
 

When drawing is in background

Reimplemented in QSCAxesShadow.

QSPt3f QSCObject::canvasToMixed const QSPt3f   pos,
int    xCoordOut,
int    yCoordOut,
int    zCoordOut,
double    dpi
 

If there are no parent axes it always maps pixlesToMM. Useful tool to use in your own objects. See QSAxes::CoordinateSystem

QSCObjectCollection* QSCObject::collection   const [inline]
 

Returns collection to which this object belongs to or NULL. If collection is not autoDelete object doesn't belong to it.

QSAxis* QSCObject::defaultAxis int    axisType const
 

Default X,Y or Z axis.

int QSCObject::defaultXAxis   const
 

Returns an index of the default axis

int QSCObject::defaultYAxis   const
 

Returns an index of the default axis

int QSCObject::defaultZAxis   const
 

Returns an index of the default axis

virtual void QSCObject::draw QSDrv   drv,
bool    blocking = true,
bool    transparent = true
[pure virtual]
 

Requests a repaint operation. If blocking is false the driver is copied using QSDrv::copy(), this function returns and drawing is performed in the background

Implemented in QSCAxesShadow.

virtual void QSCObject::forceUpdate   [virtual, slot]
 

Emits sigUpdate()

Reimplemented in QSCAxesShadow.

QSCGroup* QSCObject::group   const [inline]
 

Returns object's parent group if it is grouped or NULL.

virtual bool QSCObject::isAxesShadow   [inline, virtual]
 

Don't change it. It must always return 'false'. Do not reimplement this function in your own objects !.

Reimplemented in QSCAxesShadow.

virtual bool QSCObject::isHit const QSPt2f   p,
QSDrv   drv
[inline, virtual]
 

Return true if object is hit by mouse click.

Reimplemented in QSCAxesShadow.

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

Saves all QObject properties

Reimplemented from QSSerializable.

Reimplemented in QSCAxesShadow.

virtual void QSCObject::lower   [virtual]
 

Lowers object on a parent collection stack.

QSPt3f QSCObject::mixedToCanvas const QSPt3f   pos,
int    xCoordIn,
int    yCoordIn,
int    zCoordIn,
double    dpi
 

Maps position 'pos' to canvas ( screen ) coords. It is a simple wrapper around QSAxes::mixedToCanvas(). If there are no parent axes it always maps mmToPixels Returns a depth also. See QSAxes::CoordinateSystem

virtual QString QSCObject::name   [inline, virtual]
 

Returns an object's name ( for a list of object etc. )

Reimplemented in QSCAxesShadow.

virtual void QSCObject::paint QPainter *    p,
double    dpi = 72.0,
bool    blocking = true,
bool    transparent = true
[virtual]
 

Requests a repaint operation. If blocking is false the painter is copied using QSDrvQt::copyPainter(), this function returns and drawing is performed in the background

Reimplemented in QSCAxesShadow.

virtual void QSCObject::paintSkeleton QPainter *    p,
double    dpi = 72.0
[virtual]
 

Paint simplified version of this object ( called when resizing, redrawing ).

Reimplemented in QSCAxesShadow.

virtual void QSCObject::parametersChanged   [virtual, slot]
 

Emits sigUpdate()

virtual void QSCObject::parametersChanging   [virtual, slot]
 

Calls stop()

QSAxes* QSCObject::parentAxes   const [inline]
 

Returns a parent axes or NULL

virtual void QSCObject::raise   [virtual]
 

Raises object on a parent collection stack.

virtual QSPt2f QSCObject::rCenter QSDrv   drv [virtual]
 

Return a center of a rotation.

virtual void QSCObject::reorder int    newPosition [virtual]
 

Moves object to position 'newPosition' on a parent collection stack.

QSCObjectCollection* QSCObject::rootCollection  
 

Returns a root group of this object It digs through all group hierarchy. It will be usually the main object collection on QSPage.

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

Restores all QObject properties

Reimplemented from QSSerializable.

Reimplemented in QSCAxesShadow.

virtual void QSCObject::setAngle int    deg [virtual]
 

Called when a new angle is set.

virtual void QSCObject::setAutoUpdates bool    enabled [virtual]
 

Control whether sigParametersChnged emits sigUpdate

Reimplemented in QSCAxesShadow.

virtual void QSCObject::setBox const QSRectf   canvas_rect,
QSDrv   drv
[virtual]
 

Resize to canvas rect. Rect can be unnormalized ( size can be < 0 ). Drv ( its dpi value ) is used to map this values to mm's, calculating sizes of text labels, etc.

Reimplemented in QSCAxesShadow.

virtual void QSCObject::setCollection QSCObjectCollection   collection [protected, virtual]
 

Called by collection when this object is inserted or removed (collection=NULL) from its list.

void QSCObject::setDefaultAxis QSAxis   axis
 

Sets default X,Y or Z axia. Does not emit sigUpdate.

void QSCObject::setDefaultXAxis int    axisIndex
 

Sets the default axis.

void QSCObject::setDefaultYAxis int    axisIndex
 

Sets the default axis.

void QSCObject::setDefaultZAxis int    axisIndex
 

Sets the default axis.

virtual void QSCObject::setGroup QSCGroup   group [protected, virtual]
 

Called when object is grouped or ungrouped(group=NULL)

virtual void QSCObject::setParentAxes QSAxes   axes [virtual]
 

Sets a parent axes object. Position of this object can be set as a relative to the parent object position. This function is called by QSAxes object ( or rather by its shadow QSCObject ), when this object is grouped with axes.

Reimplemented in QSCAxesShadow.

void QSCObject::sigUpdate   [signal]
 

Parameters has changed ( the same as a signal above ).

void QSCObject::sigUpdate QSCObject *    me [signal]
 

Parameters has changed

virtual void QSCObject::stop   [inline, virtual]
 

Stops repainting immediately. This should be reimplemented if you allowind to repaint object in background.

Reimplemented in QSCAxesShadow.

virtual int QSCObject::style   [inline, virtual]
 

Returns a bitwise-OR of Style values. Informs the parent what actions on this object are allowed. Currently not used.

Reimplemented in QSCAxesShadow.

virtual void QSCObject::toBack   [virtual]
 

Sends object to back on a parent collection stack.

virtual void QSCObject::toFront   [virtual]
 

Brings object to front on a parent collection stack.


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