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

#include <zq_scale.hpp>

Inheritance diagram for ZqScale:
ZqView ZqbNatGrpMember ZqObject ZqbNatGrpMember ZqbVisible ZqbAutoName ZqbVisible ZqbAutoName ZqbView ZqObject ZqbView ZqObject ZqCustomScale

Public Types

enum  Placement {
  Undefined, TopSide, BottomSide, LeftSide,
  RightSide, Undefined, TopSide, BottomSide,
  LeftSide, RightSide
}
 
enum  AxisDecor {
  Standard = 0x0000, NoSubticks = 0x0001, NoTicks = 0x0002, NoLabels = 0x0004,
  Standard = 0x0000, NoSubticks = 0x0001, NoTicks = 0x0002, NoLabels = 0x0004
}
 
enum  Placement {
  Undefined, TopSide, BottomSide, LeftSide,
  RightSide, Undefined, TopSide, BottomSide,
  LeftSide, RightSide
}
 
enum  AxisDecor {
  Standard = 0x0000, NoSubticks = 0x0001, NoTicks = 0x0002, NoLabels = 0x0004,
  Standard = 0x0000, NoSubticks = 0x0001, NoTicks = 0x0002, NoLabels = 0x0004
}
 

Public Member Functions

 ZqScale (ZqbNatGroup &rNatAxis, const char *szName=NULL)
 
 ZqScale (ZqbNatGroup &rNatAxis, ZqbPlaceholder *pPh, const char *szName=NULL)
 
virtual void setPen (const QPen &pen)
 
virtual const QPen & getPen () const
 
virtual QPen & pen ()
 
virtual void setFont (const QFont &font)
 
virtual const QFont & getFont () const
 
virtual QFont & font ()
 
virtual void setPlacement (Placement ePlacement)
 
virtual Placement getPlacement () const
 
virtual void setIntegerTicks (bool bFlag)
 
virtual bool isIntegerTicks () const
 
virtual void setAxisDecor (int mMode)
 
virtual int getAxisDecor () const
 
virtual void redraw (QPainter &paint)
 
virtual void updateLimits (QPainter *paint=NULL)
 
virtual void onSetCoords ()
 
virtual QString prepareLabel (double fCoord)
 
virtual void prepareTicks (ZqbNatGroup::Ticks &ticks)
 
virtual bool insideRect (QPoint p)
 
bool isRect (QPoint p)
 
 ZqScale (ZqbNatGroup &rNatAxis, const char *szName=NULL)
 
 ZqScale (ZqbNatGroup &rNatAxis, ZqbPlaceholder *pPh, const char *szName=NULL)
 
virtual void setPen (const QPen &pen)
 
virtual const QPen & getPen () const
 
virtual QPen & pen ()
 
virtual void setFont (const QFont &font)
 
virtual const QFont & getFont () const
 
virtual QFont & font ()
 
virtual void setPlacement (Placement ePlacement)
 
virtual Placement getPlacement () const
 
virtual void setIntegerTicks (bool bFlag)
 
virtual bool isIntegerTicks () const
 
virtual void setAxisDecor (int mMode)
 
virtual int getAxisDecor () const
 
virtual void redraw (QPainter &paint)
 
virtual void updateLimits (QPainter *paint=NULL)
 
virtual void onSetCoords ()
 
virtual QString prepareLabel (double fCoord)
 
virtual void prepareTicks (ZqbNatGroup::Ticks &ticks)
 
virtual bool insideRect (QPoint p)
 
bool isRect (QPoint p)
 
virtual bool compatibleDoc (const ZdDocument *pDoc) const
 
- 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)
 
virtual void detachDoc ()
 
 ZqView (const char *szName=NULL)
 
 ZqView (ZqbPlaceholder *pPh, const char *szName=NULL)
 
virtual void updateView ()
 
virtual void attachDoc (ZdDocument *pData)
 
virtual void detachDoc ()
 
- 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 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 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 Member Functions inherited from ZqbNatGrpMember
 ZqbNatGrpMember (ZqbNatGroup *pNatGroup)
 
 ZqbNatGrpMember (ZqbNatGroup *pNatGroup, void(*CustomOnSetCoord)(void *), void *pUserData=NULL)
 
virtual ~ZqbNatGrpMember ()
 
virtual ZqbNatGroupgroup () const
 
virtual void unsetBounds ()
 
virtual void setBounds (double b[2])
 
void setBounds (double b1, double b2)
 
virtual bool getBounds (double b[2]=NULL) const
 
virtual void onTickChange ()
 
 ZqbNatGrpMember (ZqbNatGroup *pNatGroup)
 
 ZqbNatGrpMember (ZqbNatGroup *pNatGroup, void(*CustomOnSetCoord)(void *), void *pUserData=NULL)
 
virtual ~ZqbNatGrpMember ()
 
virtual ZqbNatGroupgroup () const
 
virtual void unsetBounds ()
 
virtual void setBounds (double b[2])
 
void setBounds (double b1, double b2)
 
virtual bool getBounds (double b[2]=NULL) const
 

Static Public Attributes

static int s_iMainTickSize
 
static int s_iSecTickSize
 
static int s_iLabelOffset
 
static int s_iBetweenLabels
 

Protected Member Functions

void adjustSizeLimits (QPainter &paint)
 
virtual void adjustSizeLimits (QPainter &paint)
 

Protected Attributes

QPen m_qPen
 
QFont m_qFont
 
Placement m_ePlacement
 
bool m_bIntegerLabels
 
int m_mAxisDecor
 
- 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
 
- Protected Attributes inherited from ZqbNatGrpMember
ZqbNatGroupm_pNatGroup
 
bool m_bKnownBounds
 
double m_fBounds [2]
 
void(* m_pCustomOnSetCoord )(void *pUserData)
 
void * m_pUserData
 

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 scale drawing.

test_zq_scale_1.png

Member Enumeration Documentation

Axis decoration variants.

Enumerator
Standard 

Default decoration includes main and subticks and all labels drawing near main ticks.

NoSubticks 

Subticks are off.

NoTicks 

Ticks except at the ends of the axis are off.

NoLabels 

Labels except at the ends of the axis are off.

Standard 

Default decoration includes main and subticks and all labels drawing near main ticks.

NoSubticks 

Subticks are off.

NoTicks 

Ticks except at the ends of the axis are off.

NoLabels 

Labels except at the ends of the axis are off.

Axis decoration variants.

Enumerator
Standard 

Default decoration includes main and subticks and all labels drawing near main ticks.

NoSubticks 

Subticks are off.

NoTicks 

Ticks except at the ends of the axis are off.

NoLabels 

Labels except at the ends of the axis are off.

Standard 

Default decoration includes main and subticks and all labels drawing near main ticks.

NoSubticks 

Subticks are off.

NoTicks 

Ticks except at the ends of the axis are off.

NoLabels 

Labels except at the ends of the axis are off.

Placement of the scale which defines its drawing orientation (horizontal or vertical) and axis and text alignment.

Enumerator
Undefined 

Prevents drawing.

TopSide 

Horizontal with tick labels over the axis.

BottomSide 

Horizontal with tick labels under the axis.

LeftSide 

Vertical with tick labels from the left side of axis line.

RightSide 

Vertical with tick labels from the right side of axis line.

Undefined 

Prevents drawing.

TopSide 

Horizontal with tick labels over the axis.

BottomSide 

Horizontal with tick labels under the axis.

LeftSide 

Vertical with tick labels from the left side of axis line.

RightSide 

Vertical with tick labels from the right side of axis line.

Placement of the scale which defines its drawing orientation (horizontal or vertical) and axis and text alignment.

Enumerator
Undefined 

Prevents drawing.

TopSide 

Horizontal with tick labels over the axis.

BottomSide 

Horizontal with tick labels under the axis.

LeftSide 

Vertical with tick labels from the left side of axis line.

RightSide 

Vertical with tick labels from the right side of axis line.

Undefined 

Prevents drawing.

TopSide 

Horizontal with tick labels over the axis.

BottomSide 

Horizontal with tick labels under the axis.

LeftSide 

Vertical with tick labels from the left side of axis line.

RightSide 

Vertical with tick labels from the right side of axis line.

Constructor & Destructor Documentation

ZqScale::ZqScale ( ZqbNatGroup rNatAxis,
const char *  szName = NULL 
)

Create scale object without placeholder. Natural coordinates group is provided.

ZqScale::ZqScale ( ZqbNatGroup rNatAxis,
ZqbPlaceholder pPh,
const char *  szName = NULL 
)

Create scale object at given place. Natural coordinates group is provided.

ZqScale::ZqScale ( ZqbNatGroup rNatAxis,
const char *  szName = NULL 
)

Create scale object without placeholder. Natural coordinates group is provided.

ZqScale::ZqScale ( ZqbNatGroup rNatAxis,
ZqbPlaceholder pPh,
const char *  szName = NULL 
)

Create scale object at given place. Natural coordinates group is provided.

Member Function Documentation

void ZqScale::adjustSizeLimits ( QPainter &  paint)
protected

Adjust limitations of the scale according to current painter device settings.

virtual void ZqScale::adjustSizeLimits ( QPainter &  paint)
protectedvirtual

Adjust limitations of the scale according to current painter device settings.

Reimplemented in ZqCustomScale.

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

Return true if passed object is in list of compatible documents for this view. Usual implemention is handy to implement using findTypeAmong():

Implements ZqbView.

Reimplemented in ZqCustomScale.

INLINE QFont & ZqScale::font ( )
virtual

Access font used for label drawing on main ticks.

virtual QFont& ZqScale::font ( )
virtual

Access font used for label drawing on main ticks.

virtual int ZqScale::getAxisDecor ( ) const
virtual

Return current mode of axis decoration.

INLINE int ZqScale::getAxisDecor ( ) const
virtual

Return current mode of axis decoration.

virtual const QFont& ZqScale::getFont ( ) const
virtual

Get font used for label drawing on main ticks.

INLINE const QFont & ZqScale::getFont ( ) const
virtual

Get font used for label drawing on main ticks.

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

Get pen used for scale drawing.

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

Get pen used for scale drawing.

INLINE ZqScale::Placement ZqScale::getPlacement ( ) const
virtual

Get placement of the scale.

virtual Placement ZqScale::getPlacement ( ) const
virtual

Get placement of the scale.

virtual bool ZqScale::insideRect ( QPoint  p)
virtual

Check for the point belongs to this rectangle.

virtual bool ZqScale::insideRect ( QPoint  p)
virtual

Check for the point belongs to this rectangle.

INLINE bool ZqScale::isIntegerTicks ( ) const
virtual

Return flag of integer numbers used for ticks.

virtual bool ZqScale::isIntegerTicks ( ) const
virtual

Return flag of integer numbers used for ticks.

virtual void ZqScale::onSetCoords ( )
virtual

Be warned about coordinate changes to adjust size of scale according to current natural coordinates.

Reimplemented from ZqbNatGrpMember.

virtual void ZqScale::onSetCoords ( )
virtual

Be warned about coordinate changes to adjust size of scale according to current natural coordinates.

Reimplemented from ZqbNatGrpMember.

virtual QPen& ZqScale::pen ( )
virtual

Access pen used for scale drawing.

INLINE QPen & ZqScale::pen ( )
virtual

Access pen used for scale drawing.

virtual QString ZqScale::prepareLabel ( double  fCoord)
virtual

Prepare string with label for given tick coordinate. May be reimplemented to obtain another format or other effects. To avoid drawing label just return empty string.

virtual QString ZqScale::prepareLabel ( double  fCoord)
virtual

Prepare string with label for given tick coordinate. May be reimplemented to obtain another format or other effects. To avoid drawing label just return empty string.

virtual void ZqScale::prepareTicks ( ZqbNatGroup::Ticks ticks)
virtual

Prepare array of ticks for drawing including subdivision ticks.

virtual void ZqScale::prepareTicks ( ZqbNatGroup::Ticks ticks)
virtual

Prepare array of ticks for drawing including subdivision ticks.

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

Draw scale.

Reimplemented from ZqObject.

Reimplemented in ZqCustomScale.

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

Draw scale.

Reimplemented from ZqObject.

Reimplemented in ZqCustomScale.

INLINE void ZqScale::setAxisDecor ( int  mMode)
virtual

Set axis decoration mode composed of ORed AxisDecor values.

virtual void ZqScale::setAxisDecor ( int  mMode)
virtual

Set axis decoration mode composed of ORed AxisDecor values.

virtual void ZqScale::setFont ( const QFont &  font)
virtual

Set font for label drawing on main ticks.

INLINE void ZqScale::setFont ( const QFont &  font)
virtual

Set font for label drawing on main ticks.

INLINE void ZqScale::setIntegerTicks ( bool  bFlag)
virtual

Set flag of integer numbers used for ticks. It allows to prevent #####.0 when it's known for sure that ticks are integer.

Set flag of integer numbers used for ticks. It allows to prevent

.0 when it's known for sure that ticks are integer.
virtual void ZqScale::setIntegerTicks ( bool  bFlag)
virtual

Set flag of integer numbers used for ticks. It allows to prevent #####.0 when it's known for sure that ticks are integer.

virtual void ZqScale::setPen ( const QPen &  pen)
virtual

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

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

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

virtual void ZqScale::setPlacement ( Placement  ePlacement)
virtual

Set placement of the scale relative to the target placeholder.

INLINE void ZqScale::setPlacement ( ZqScale::Placement  ePlacement)
virtual

Set placement of the scale relative to the target placeholder.

virtual void ZqScale::updateLimits ( QPainter *  paint = NULL)
virtual

Adjust size of scale according to current font settings.

Reimplemented from ZqObject.

virtual void ZqScale::updateLimits ( QPainter *  paint = NULL)
virtual

Adjust size of scale according to current font settings.

Reimplemented from ZqObject.

Member Data Documentation

bool ZqScale::m_bIntegerLabels
protected

Flag of integer numbers used for tick labels. false by default.

Placement ZqScale::m_ePlacement
protected

Placement defines the kind of scale to draw. Top and bottom locations define horizontal scale; left and right - vertical.

int ZqScale::m_mAxisDecor
protected

Mask of decoration mode of the axis drawing. Standard by default.

QFont ZqScale::m_qFont
protected

Stored font used for label drawing on main ticks.

QPen ZqScale::m_qPen
protected

Stored pen used for drawing scale.

static int ZqScale::s_iMainTickSize
static

Some visual properties which can be changed not very frequently


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