UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
ZqCurve Class Reference

#include <zq_curve.hpp>

Inheritance diagram for ZqCurve:
ZqView ZqView ZqbView ZqObject ZqbView ZqObject ZqbView ZqObject ZqbView ZqObject

Public Types

enum  Interpolation {
  BarGraph = -1, StepCurve = 0, LinearCurve = 1, BarGraph = -1,
  StepCurve = 0, LinearCurve = 1
}
 
enum  Interpolation {
  BarGraph = -1, StepCurve = 0, LinearCurve = 1, BarGraph = -1,
  StepCurve = 0, LinearCurve = 1
}
 

Public Member Functions

 ZqCurve (ZqbNatGroup &rNatArg, ZqbNatGroup &rNatFunc, const char *szName=NULL)
 
 ZqCurve (ZqbNatGroup &rNatArg, ZqbNatGroup &rNatFunc, ZqbPlaceholder *pPh, const char *szName=NULL)
 
virtual bool compatibleDoc (const ZdDocument *pDoc) const
 
virtual void attachData (ZdFunction *pData, ZdFuncArgDir eArgDir)
 
virtual void detachDoc ()
 
virtual ZdFunctiondata ()
 
virtual ZdFuncArgDir argDir () const
 
virtual double x (int i)
 
virtual double y (int i)
 
virtual void xMinMax (double mm[2])
 
virtual void yMinMax (double mm[2])
 
virtual void setPen (const QPen &pen)
 
virtual const QPen & getPen () const
 
virtual QPen & pen ()
 
virtual void setInterpolation (int interp)
 
virtual int getInterpolation () const
 
virtual void setAutoSort (bool bSortFlag)
 
virtual bool getAutoSort () const
 
virtual void setBaseLevel (double fBase)
 
virtual double getBaseLevel () const
 
virtual void setBarSpace (double fArgDelta)
 
virtual double getBarSpace () const
 
virtual void redraw (QPainter &paint)
 
 ZqCurve (ZqbNatGroup &rNatArg, ZqbNatGroup &rNatFunc, const char *szName=NULL)
 
 ZqCurve (ZqbNatGroup &rNatArg, ZqbNatGroup &rNatFunc, ZqbPlaceholder *pPh, const char *szName=NULL)
 
virtual bool compatibleDoc (const ZdDocument *pDoc) const
 
virtual void attachData (ZdFunction *pData, ZdFuncArgDir eArgDir)
 
virtual void detachDoc ()
 
virtual ZdFunctiondata ()
 
virtual ZdFuncArgDir argDir () const
 
virtual double x (int i)
 
virtual double y (int i)
 
virtual void xMinMax (double mm[2])
 
virtual void yMinMax (double mm[2])
 
virtual void setPen (const QPen &pen)
 
virtual const QPen & getPen () const
 
virtual QPen & pen ()
 
virtual void setInterpolation (int interp)
 
virtual int getInterpolation () const
 
virtual void setAutoSort (bool bSortFlag)
 
virtual bool getAutoSort () const
 
virtual void setBaseLevel (double fBase)
 
virtual double getBaseLevel () const
 
virtual void setBarSpace (double fArgDelta)
 
virtual double getBarSpace () const
 
virtual void redraw (QPainter &paint)
 
- Public Member Functions inherited from ZqView
 ZqView (const char *szName=NULL)
 
 ZqView (ZqbPlaceholder *pPh, const char *szName=NULL)
 
virtual void updateView ()
 
virtual void attachDoc (ZdDocument *pData)
 
 ZqView (const char *szName=NULL)
 
 ZqView (ZqbPlaceholder *pPh, const char *szName=NULL)
 
virtual void updateView ()
 
virtual void attachDoc (ZdDocument *pData)
 
- Public Member Functions inherited from ZqObject
 ZqObject (const char *szName=NULL)
 
 ZqObject (ZqbPlaceholder *pPh, const char *szName=NULL)
 
virtual ~ZqObject ()
 
virtual void debugState ()
 
virtual void clearPlace ()
 
virtual ZqbPlaceholderVector * placeholders ()
 
virtual ZqbEventHint input (QEvent &event)
 
virtual void updateLimits (QPainter *paint=NULL)
 
virtual void updateGeometry ()
 
virtual QPainter * getScreenPainter () const
 
virtual void setScreenPainter (QPainter *pPainter)
 
virtual QzqAreagetArea () const
 
virtual QWidget * getAreaWidget () const
 
virtual void setAreaWidget (QWidget *pWidget)
 
virtual bool isHardcopy () const
 
bool isPlaced () const
 
ZqbPlaceholdergetPlace () const
 
ZqbPixGrpMemberpx () const
 
ZqbPixGrpMemberpy () const
 
bool getRect (QRect &rect) const
 
virtual bool attachToPlace (ZqbPlaceholder *pPh)
 
virtual bool detachFromPlace ()
 
virtual void setDirty ()
 
virtual void resetDirty ()
 
virtual bool isDirty () const
 
void setInteractive (bool bInteractive)
 
bool isInteractive () const
 
virtual void fullRedraw (bool bForce=false)
 
virtual void interactiveRedraw ()
 
 ZqObject (const char *szName=NULL)
 
 ZqObject (ZqbPlaceholder *pPh, const char *szName=NULL)
 
virtual ~ZqObject ()
 
virtual void debugState ()
 
virtual void clearPlace ()
 
virtual ZqbPlaceholderVector * placeholders ()
 
virtual ZqbEventHint input (QEvent &event)
 
virtual void updateLimits (QPainter *paint=NULL)
 
virtual void updateGeometry ()
 
virtual QPainter * getScreenPainter () const
 
virtual void setScreenPainter (QPainter *pPainter)
 
virtual QzqAreagetArea () const
 
virtual QWidget * getAreaWidget () const
 
virtual void setAreaWidget (QWidget *pWidget)
 
virtual bool isHardcopy () const
 
bool isPlaced () const
 
ZqbPlaceholdergetPlace () const
 
ZqbPixGrpMemberpx () const
 
ZqbPixGrpMemberpy () const
 
bool getRect (QRect &rect) const
 
virtual bool attachToPlace (ZqbPlaceholder *pPh)
 
virtual bool detachFromPlace ()
 
virtual void setDirty ()
 
virtual void resetDirty ()
 
virtual bool isDirty () const
 
void setInteractive (bool bInteractive)
 
bool isInteractive () const
 
virtual void fullRedraw (bool bForce=false)
 
virtual void interactiveRedraw ()
 
- Public Member Functions inherited from ZqbAutoName
 ZqbAutoName (int *pCounter, const char *szRoot, const char *szCustomName=NULL)
 
virtual ~ZqbAutoName ()
 
 ZqbAutoName (int *pCounter, const char *szRoot, const char *szCustomName=NULL)
 
virtual ~ZqbAutoName ()
 
- Public Member Functions inherited from ZqbName
 ZqbName (const char *szRoot, const char *szCustomName=NULL)
 
 ZqbName (const ZqbName &name)
 
virtual ~ZqbName ()
 
ZqbNameoperator= (const ZqbName &name)
 
virtual const char * getName () const
 
virtual const char * getType () const
 
bool hasName (const char *szString) const
 
 ZqbName (const char *szRoot, const char *szCustomName=NULL)
 
 ZqbName (const ZqbName &name)
 
virtual ~ZqbName ()
 
ZqbNameoperator= (const ZqbName &name)
 
virtual const char * getName () const
 
virtual const char * getType () const
 
bool hasName (const char *szString) const
 
- Public Member Functions inherited from ZqbVisible
 ZqbVisible (bool bDrawable=false, bool bInputable=false, bool bTipable=false)
 
virtual ~ZqbVisible ()
 
virtual bool isDrawable () const
 
virtual void setDrawable (bool bFlag)
 
virtual void redraw ()
 
virtual void setTipable (bool bFlag)
 
virtual bool isTipable () const
 
virtual bool tip (const QPoint &p, QString &qsShort, QString &qsLong)
 
virtual bool isInputable () const
 
virtual void setInputable (bool bFlag)
 
virtual bool getRect (QRect &)
 
virtual bool setRect (const QRect &)
 
 ZqbVisible (bool bDrawable=false, bool bInputable=false, bool bTipable=false)
 
virtual ~ZqbVisible ()
 
virtual bool isDrawable () const
 
virtual void setDrawable (bool bFlag)
 
virtual void redraw ()
 
virtual void setTipable (bool bFlag)
 
virtual bool isTipable () const
 
virtual bool tip (const QPoint &p, QString &qsShort, QString &qsLong)
 
virtual bool isInputable () const
 
virtual void setInputable (bool bFlag)
 
virtual bool getRect (QRect &)
 
virtual bool setRect (const QRect &)
 
- Public Member Functions inherited from ZqbView
 ZqbView (const char *szName=NULL)
 
virtual ~ZqbView ()
 
virtual ZdDocumentdoc ()
 
virtual void updateDoc ()
 
 ZqbView (const char *szName=NULL)
 
virtual ~ZqbView ()
 
virtual ZdDocumentdoc ()
 
virtual void updateDoc ()
 

Public Attributes

ZqbNatGrpMember m_Arg
 
ZqbNatGrpMember m_Func
 

Protected Member Functions

void addSegment (double x[2], double y[2], double rx[2], double ry[2])
 
void addPoint (double x, double y, double rx[2], double ry[2])
 
void addBar (double x[2], double y[2], double rx[2], double ry[2])
 
void addSegment (double x[2], double y[2], double rx[2], double ry[2])
 
void addPoint (double x, double y, double rx[2], double ry[2])
 
void addBar (double x[2], double y[2], double rx[2], double ry[2])
 

Protected Attributes

QPen m_qPen
 
int m_iInterpolation
 
bool m_bAutoSort
 
ZdFuncArgDir m_eArgDir
 
QPointArray m_Nodes
 
std::vector< bool > m_Linked
 
ZdRealFuncm_zdFuncSorted
 
double m_fBaseFuncLevel
 
double m_fSpaceBetweenBars
 
QPolygon m_Nodes
 
- Protected Attributes inherited from ZqObject
ZqbPlaceholderm_pPh
 
ZqbPixGrpMemberm_pPx
 
ZqbPixGrpMemberm_pPy
 
bool m_bInteractive
 
- Protected Attributes inherited from ZqbName
char * m_szName
 
char * m_szRoot
 

Additional Inherited Members

- Static Public Member Functions inherited from ZqbView
static bool findTypeAmong (const ZdDocument *pDoc, const char *szExpectedType1,...)
 
static bool findTypeAmong (const ZdDocument *pDoc, const char *szExpectedType1,...)
 

Detailed Description

Object for linear interpolated or step broken curve or bar graph drawing.

By default curve does not have attached data, so one need to attachData() to see some drawings.

test_zq_curve_1.png
LinearCurve mode of interpolation
test_zq_curve_3.png
BarGraph mode of interpolation

Member Enumeration Documentation

Convenient values used to interpolate curve before drawing.

Enumerator
BarGraph 

bar graph

StepCurve 

no interpolation (steps)

LinearCurve 

linear interpolation

BarGraph 

bar graph

StepCurve 

no interpolation (steps)

LinearCurve 

linear interpolation

Convenient values used to interpolate curve before drawing.

Enumerator
BarGraph 

bar graph

StepCurve 

no interpolation (steps)

LinearCurve 

linear interpolation

BarGraph 

bar graph

StepCurve 

no interpolation (steps)

LinearCurve 

linear interpolation

Constructor & Destructor Documentation

ZqCurve::ZqCurve ( ZqbNatGroup rNatArg,
ZqbNatGroup rNatFunc,
const char *  szName = NULL 
)

Create curve object without placeholder. Natural coordinates for argument and function axis are provided.

ZqCurve::ZqCurve ( ZqbNatGroup rNatArg,
ZqbNatGroup rNatFunc,
ZqbPlaceholder pPh,
const char *  szName = NULL 
)

Create curve object at given place. Natural coordinates for argument and function axis are provided.

ZqCurve::ZqCurve ( ZqbNatGroup rNatArg,
ZqbNatGroup rNatFunc,
const char *  szName = NULL 
)

Create curve object without placeholder. Natural coordinates for argument and function axis are provided.

ZqCurve::ZqCurve ( ZqbNatGroup rNatArg,
ZqbNatGroup rNatFunc,
ZqbPlaceholder pPh,
const char *  szName = NULL 
)

Create curve object at given place. Natural coordinates for argument and function axis are provided.

Member Function Documentation

void ZqCurve::addBar ( double  x[2],
double  y[2],
double  rx[2],
double  ry[2] 
)
protected

Add one more bar to the array of node points used to draw histogram. The bar is clipped by given rectangle (rx,ry).

void ZqCurve::addBar ( double  x[2],
double  y[2],
double  rx[2],
double  ry[2] 
)
protected

Add one more bar to the array of node points used to draw histogram. The bar is clipped by given rectangle (rx,ry).

void ZqCurve::addPoint ( double  x,
double  y,
double  rx[2],
double  ry[2] 
)
protected

Add one more standalone point to the array of node points.

void ZqCurve::addPoint ( double  x,
double  y,
double  rx[2],
double  ry[2] 
)
protected

Add one more standalone point to the array of node points.

void ZqCurve::addSegment ( double  x[2],
double  y[2],
double  rx[2],
double  ry[2] 
)
protected

Add one more segment to the array of node points. The segment is clipped by placeholder rectangle.

void ZqCurve::addSegment ( double  x[2],
double  y[2],
double  rx[2],
double  ry[2] 
)
protected

Add one more segment to the array of node points. The segment is clipped by placeholder rectangle.

INLINE ZdFuncArgDir ZqCurve::argDir ( ) const
virtual

Return direction of function's argument axis. Value is not defined in case of detached state of object.

virtual ZdFuncArgDir ZqCurve::argDir ( ) const
virtual

Return direction of function's argument axis. Value is not defined in case of detached state of object.

virtual void ZqCurve::attachData ( ZdFunction pData,
ZdFuncArgDir  eArgDir 
)
virtual

Attach given function container. Publishes to group information about ranges for argument and value of function. Attaching NULL means detach operation.

virtual void ZqCurve::attachData ( ZdFunction pData,
ZdFuncArgDir  eArgDir 
)
virtual

Attach given function container. Publishes to group information about ranges for argument and value of function. Attaching NULL means detach operation.

virtual bool ZqCurve::compatibleDoc ( const ZdDocument pDoc) const
virtual

Return true if passed object is in list of compatible documents for this view. ZdFunction and subclasses are welcome.

Implements ZqbView.

INLINE bool ZqCurve::compatibleDoc ( const ZdDocument pDoc) const
virtual

Return true if passed object is in list of compatible documents for this view. ZdFunction and subclasses are welcome.

Implements ZqbView.

INLINE ZdFunction * ZqCurve::data ( )
virtual

Return pointer to attached data container or NULL if no data were attached.

virtual ZdFunction* ZqCurve::data ( )
virtual

Return pointer to attached data container or NULL if no data were attached.

virtual void ZqCurve::detachDoc ( )
virtual

Detach function. Withdraws information about ranges for argument and value of function.

Reimplemented from ZqView.

virtual void ZqCurve::detachDoc ( )
virtual

Detach function. Withdraws information about ranges for argument and value of function.

Reimplemented from ZqView.

INLINE bool ZqCurve::getAutoSort ( ) const
virtual

Get flag of automatic ordering of data sample before drawing.

virtual bool ZqCurve::getAutoSort ( ) const
virtual

Get flag of automatic ordering of data sample before drawing.

INLINE double ZqCurve::getBarSpace ( ) const
virtual

Get the size of empty space between neighbor bars.

virtual double ZqCurve::getBarSpace ( ) const
virtual

Get the size of empty space between neighbor bars.

INLINE double ZqCurve::getBaseLevel ( ) const
virtual

Get base level of function drawing.

virtual double ZqCurve::getBaseLevel ( ) const
virtual

Get base level of function drawing.

virtual int ZqCurve::getInterpolation ( ) const
virtual

Get type of interpolation.

INLINE int ZqCurve::getInterpolation ( ) const
virtual

Get type of interpolation.

virtual const QPen& ZqCurve::getPen ( ) const
virtual

Get pen used for curve drawing.

INLINE const QPen & ZqCurve::getPen ( ) const
virtual

Get pen used for curve drawing.

virtual QPen& ZqCurve::pen ( )
virtual

Access pen used for curve drawing.

INLINE QPen & ZqCurve::pen ( )
virtual

Access pen used for curve drawing.

virtual void ZqCurve::redraw ( QPainter &  paint)
virtual

Draw curve if some data container is attached.

Reimplemented from ZqObject.

virtual void ZqCurve::redraw ( QPainter &  paint)
virtual

Draw curve if some data container is attached.

Reimplemented from ZqObject.

virtual void ZqCurve::setAutoSort ( bool  bSortFlag)
virtual

Set automatic ordering of data samples before drawing.

INLINE void ZqCurve::setAutoSort ( bool  bSortFlag)
virtual

Set automatic ordering of data samples before drawing.

virtual void ZqCurve::setBarSpace ( double  fArgDelta)
virtual

Set the size of empty space between neighbor bars (applied to BarGraph mode). Default value is 0.

INLINE void ZqCurve::setBarSpace ( double  fArgDelta)
virtual

Set the size of empty space between neighbor bars (applied to BarGraph mode). Default value is 0.

virtual void ZqCurve::setBaseLevel ( double  fBase)
virtual

Set base level of function drawing (applied to BarGraph mode). Default value is 0.

INLINE void ZqCurve::setBaseLevel ( double  fBase)
virtual

Set base level of function drawing (applied to BarGraph mode). Default value is 0.

virtual void ZqCurve::setInterpolation ( int  interp)
virtual

Set type of interpolation:

  • -1 - bar graph;
  • 0 - no interpolation (steps);
  • 1 - linear interpolation.
INLINE void ZqCurve::setInterpolation ( int  interp)
virtual

Set type of interpolation:

  • -1 - bar graph;
  • 0 - no interpolation (steps);
  • 1 - linear interpolation.
virtual void ZqCurve::setPen ( const QPen &  pen)
virtual

Set pen for curve drawing. Default pen color is black.

INLINE void ZqCurve::setPen ( const QPen &  pen)
virtual

Set pen for curve drawing. Default pen color is black.

INLINE double ZqCurve::x ( int  i)
virtual

Get natural X coordinate value for i-th data item.

virtual double ZqCurve::x ( int  i)
virtual

Get natural X coordinate value for i-th data item.

INLINE void ZqCurve::xMinMax ( double  mm[2])
virtual

Get minimum mm[0] and maximum mm[1] for natural X coordinate value.

virtual void ZqCurve::xMinMax ( double  mm[2])
virtual

Get minimum mm[0] and maximum mm[1] for natural X coordinate value.

INLINE double ZqCurve::y ( int  i)
virtual

Get natural Y coordinate value for i-th data item.

virtual double ZqCurve::y ( int  i)
virtual

Get natural Y coordinate value for i-th data item.

virtual void ZqCurve::yMinMax ( double  mm[2])
virtual

Get minimum mm[0] and maximum mm[1] for natural Y coordinate value.

INLINE void ZqCurve::yMinMax ( double  mm[2])
virtual

Get minimum mm[0] and maximum mm[1] for natural Y coordinate value.

Member Data Documentation

ZqbNatGrpMember ZqCurve::m_Arg

Bounds for argument values and access to natural group.

bool ZqCurve::m_bAutoSort
protected

Flag of automatic sorting of data samples before drawing. The sorting is performed in temporal buffer so data object is not changed. It's turned off by default.

ZdFuncArgDir ZqCurve::m_eArgDir
protected

Direction of function argument axis.

double ZqCurve::m_fBaseFuncLevel
protected

Base level of function drawing.

double ZqCurve::m_fSpaceBetweenBars
protected

Separation between bars in bar drawing mode. It's measured in natural values of function's argument. If the value is greater than 0 then it will be drawn of one pixel at least if possible.

ZqbNatGrpMember ZqCurve::m_Func

Bounds for function values and access to natural group.

int ZqCurve::m_iInterpolation
protected

Type of interpolation used for drawing.

  • -1 - bar graph;
  • 0 - means step interpolation;
  • 1 - means linear interpolation (default).
std::vector< bool > ZqCurve::m_Linked
protected

Array of flags of connectivity between neighbor nodes. Number of flags should be the same as in m_Nodes and the first flag is never interpreted.

QPointArray ZqCurve::m_Nodes
protected

Array of node points of actual polyline curve representation. Two neighbor nodes should be connected by line segment if the second one has true m_Linked flag and should not be connected at all otherwise.

QPolygon ZqCurve::m_Nodes
protected

Array of node points of actual polyline curve representation. Two neighbor nodes should be connected by line segment if the second one has true m_Linked flag and should not be connected at all otherwise.

QPen ZqCurve::m_qPen
protected

Stored pen used for drawing curve.

ZdRealFunc * ZqCurve::m_zdFuncSorted
protected

Special container with data sorted by argument.


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