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

#include <zq_zoom.hpp>

Inheritance diagram for ZqZoom:
ZqRubberBox ZqRubberBox ZqObject ZqObject ZqObject ZqObject ZqbVisible ZqbAutoName ZqbVisible ZqbAutoName ZqbVisible ZqbAutoName ZqbVisible ZqbAutoName ZqbVisible ZqbAutoName ZqbVisible ZqbAutoName ZqbVisible ZqbAutoName ZqbVisible ZqbAutoName

Public Types

enum  ZoomMode {
  ZoomRubberRect, ZoomInClick, ZoomOutClick, ZoomRubberRect,
  ZoomInClick, ZoomOutClick
}
 
enum  ZoomMode {
  ZoomRubberRect, ZoomInClick, ZoomOutClick, ZoomRubberRect,
  ZoomInClick, ZoomOutClick
}
 
- Public Types inherited from ZqRubberBox
enum  RangeMode {
  Vertical = 0x01, Horizontal = 0x02, Rectangle = 0x03, Vertical = 0x01,
  Horizontal = 0x02, Rectangle = 0x03
}
 
enum  RangeMode {
  Vertical = 0x01, Horizontal = 0x02, Rectangle = 0x03, Vertical = 0x01,
  Horizontal = 0x02, Rectangle = 0x03
}
 

Public Member Functions

 ZqZoom (ZqbNatGroup &rNatAxis, ZqRubberBox::RangeMode eRangeMode, const char *szName=NULL)
 
 ZqZoom (ZqbNatGroup &rNatAxisX, ZqbNatGroup &rNatAxisY, const char *szName=NULL)
 
 ZqZoom (ZqbNatGroup &rNatAxis, ZqRubberBox::RangeMode eRangeMode, ZqbPlaceholder *pPh, const char *szName=NULL)
 
 ZqZoom (ZqbNatGroup &rNatAxisX, ZqbNatGroup &rNatAxisY, ZqbPlaceholder *pPh, const char *szName=NULL)
 
virtual void zoomAll ()
 
virtual void zoomClick (float sf, double nxy[2]=NULL)
 
virtual void setZoomMode (ZoomMode eMode)
 
virtual ZoomMode getZoomMode () const
 
virtual void setScaleFactor (float fScale)
 
virtual float getScaleFactor () const
 
virtual ZqbEventHint input (QEvent &event)
 
virtual void box (QRect r)
 
virtual void click (QRect r)
 
 ZqZoom (ZqbNatGroup &rNatAxis, ZqRubberBox::RangeMode eRangeMode, const char *szName=NULL)
 
 ZqZoom (ZqbNatGroup &rNatAxisX, ZqbNatGroup &rNatAxisY, const char *szName=NULL)
 
 ZqZoom (ZqbNatGroup &rNatAxis, ZqRubberBox::RangeMode eRangeMode, ZqbPlaceholder *pPh, const char *szName=NULL)
 
 ZqZoom (ZqbNatGroup &rNatAxisX, ZqbNatGroup &rNatAxisY, ZqbPlaceholder *pPh, const char *szName=NULL)
 
virtual void zoomAll ()
 
virtual void zoomClick (float sf, double nxy[2]=NULL)
 
virtual void setZoomMode (ZoomMode eMode)
 
virtual ZoomMode getZoomMode () const
 
virtual void setScaleFactor (float fScale)
 
virtual float getScaleFactor () const
 
virtual ZqbEventHint input (QEvent &event)
 
virtual void box (QRect r)
 
virtual void click (QRect r)
 
- Public Member Functions inherited from ZqRubberBox
 ZqRubberBox (const char *szName=NULL)
 
 ZqRubberBox (ZqbPlaceholder *pPh, const char *szName=NULL)
 
virtual void setThickness (int iThickness)
 
virtual int getThickness () const
 
virtual void setRangeMode (int mMode)
 
virtual int getRangeMode () const
 
virtual void setSensExtWidth (int iWidth)
 
virtual int getSensExtWidth () const
 
virtual void setInputable (bool bFlag)
 
 ZqRubberBox (const char *szName=NULL)
 
 ZqRubberBox (ZqbPlaceholder *pPh, const char *szName=NULL)
 
virtual ~ZqRubberBox ()
 
virtual bool attachToPlace (ZqbPlaceholder *pPh)
 
virtual bool detachFromPlace ()
 
virtual void setThickness (int iThickness)
 
virtual int getThickness () const
 
virtual void setRangeMode (int mMode)
 
virtual int getRangeMode () const
 
virtual void setSensExtWidth (int iWidth)
 
virtual int getSensExtWidth () const
 
virtual void setInputable (bool bFlag)
 
- 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 void redraw (QPainter &paint)
 
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 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 void redraw (QPainter &paint)
 
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 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 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 bool getRect (QRect &)
 
virtual bool setRect (const QRect &)
 

Protected Member Functions

void zoomClick (double nc, ZqbNatGroup &group, float fScaleFactor)
 
int pos2nat (const QPoint &p, double nc[2]) const
 
void forceRedraw (ZqbNatGrpMember *pNGm)
 
void zoomClick (double nc, ZqbNatGroup &group, float fScaleFactor)
 
int pos2nat (const QPoint &p, double nc[2]) const
 
void forceRedraw (ZqbNatGrpMember *pNGm)
 
- Protected Member Functions inherited from ZqRubberBox
void drawRubberRect (const QRect &r)
 
void drawRubberRect (const QRect &r)
 
void updateRubberRect (const QRect &r)
 
void hideRubberRect ()
 

Protected Attributes

ZoomMode m_eZoomMode
 
float m_fScale
 
ZqbNatGrpMemberm_pNatX
 
ZqbNatGrpMemberm_pNatY
 
bool m_bDragToMove
 
- Protected Attributes inherited from ZqRubberBox
bool m_bDrawn
 
QRect m_qRect
 
QPoint m_qCurrent
 
QPoint m_qStart
 
int m_iThickness
 
int m_mMode
 
int m_iExtWidth
 
QRubberBand * m_qRB
 
- 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
 

Detailed Description

Class implements all standard zoom functions: zoom in by click, zoom out by click, zoom by rubber rectangle and zoom all by middle button double click.

Member Enumeration Documentation

Mode of zooming.

Enumerator
ZoomRubberRect 

Press left button and drag mouse to select rectangular area to zoom. Release left button for the action and click right button to avoid action. Clicking right button allows to undo zoom.

ZoomInClick 

Click left button to get closer view and right button for opposite action. Mouse position is used as center of scaling.

ZoomOutClick 

Click left button to get more distant view and right button for opposite action. Mouse position is used as center of scaling.

ZoomRubberRect 

Press left button and drag mouse to select rectangular area to zoom. Release left button for the action and click right button to avoid action. Clicking right button allows to undo zoom.

ZoomInClick 

Click left button to get closer view and right button for opposite action. Mouse position is used as center of scaling.

ZoomOutClick 

Click left button to get more distant view and right button for opposite action. Mouse position is used as center of scaling.

Mode of zooming.

Enumerator
ZoomRubberRect 

Press left button and drag mouse to select rectangular area to zoom. Release left button for the action and click right button to avoid action. Clicking right button allows to undo zoom.

ZoomInClick 

Click left button to get closer view and right button for opposite action. Mouse position is used as center of scaling.

ZoomOutClick 

Click left button to get more distant view and right button for opposite action. Mouse position is used as center of scaling.

ZoomRubberRect 

Press left button and drag mouse to select rectangular area to zoom. Release left button for the action and click right button to avoid action. Clicking right button allows to undo zoom.

ZoomInClick 

Click left button to get closer view and right button for opposite action. Mouse position is used as center of scaling.

ZoomOutClick 

Click left button to get more distant view and right button for opposite action. Mouse position is used as center of scaling.

Constructor & Destructor Documentation

ZqZoom::ZqZoom ( ZqbNatGroup rNatAxis,
ZqRubberBox::RangeMode  eRangeMode,
const char *  szName = NULL 
)

Create 1D zoom object without exact place. Range mode should be Vertical or Horizontal otherwise object will not function. Default mode is rubber rectangle zoom in.

ZqZoom::ZqZoom ( ZqbNatGroup rNatAxisX,
ZqbNatGroup rNatAxisY,
const char *  szName = NULL 
)

Create 2D zoom object without exact place. Default mode is rubber rectangle zoom in.

ZqZoom::ZqZoom ( ZqbNatGroup rNatAxis,
ZqRubberBox::RangeMode  eRangeMode,
ZqbPlaceholder pPh,
const char *  szName = NULL 
)

Create 1D zoom object in given placeholder. Range mode should be Vertical or Horizontal otherwise object will not function. Default mode is rubber rectangle zoom in.

ZqZoom::ZqZoom ( ZqbNatGroup rNatAxisX,
ZqbNatGroup rNatAxisY,
ZqbPlaceholder pPh,
const char *  szName = NULL 
)

Create 2D zoom object in given placeholder. Default mode is rubber rectangle zoom in.

ZqZoom::ZqZoom ( ZqbNatGroup rNatAxis,
ZqRubberBox::RangeMode  eRangeMode,
const char *  szName = NULL 
)

Create 1D zoom object without exact place. Range mode should be Vertical or Horizontal otherwise object will not function. Default mode is rubber rectangle zoom in.

ZqZoom::ZqZoom ( ZqbNatGroup rNatAxisX,
ZqbNatGroup rNatAxisY,
const char *  szName = NULL 
)

Create 2D zoom object without exact place. Default mode is rubber rectangle zoom in.

ZqZoom::ZqZoom ( ZqbNatGroup rNatAxis,
ZqRubberBox::RangeMode  eRangeMode,
ZqbPlaceholder pPh,
const char *  szName = NULL 
)

Create 1D zoom object in given placeholder. Range mode should be Vertical or Horizontal otherwise object will not function. Default mode is rubber rectangle zoom in.

ZqZoom::ZqZoom ( ZqbNatGroup rNatAxisX,
ZqbNatGroup rNatAxisY,
ZqbPlaceholder pPh,
const char *  szName = NULL 
)

Create 2D zoom object in given placeholder. Default mode is rubber rectangle zoom in.

Member Function Documentation

virtual void ZqZoom::box ( QRect  r)
virtual

Rubber rectangle zoom action processing.

Reimplemented from ZqRubberBox.

virtual void ZqZoom::box ( QRect  r)
virtual

Rubber rectangle zoom action processing.

Reimplemented from ZqRubberBox.

virtual void ZqZoom::click ( QRect  r)
virtual

Click instead of rectangle selection action processing.

Reimplemented from ZqRubberBox.

virtual void ZqZoom::click ( QRect  r)
virtual

Click instead of rectangle selection action processing.

Reimplemented from ZqRubberBox.

void ZqZoom::forceRedraw ( ZqbNatGrpMember pNGm)
protected

Prepare redrawing by setting dirty flags of all members of given natural group (obtained as pNGm->group() if !NULL).

void ZqZoom::forceRedraw ( ZqbNatGrpMember pNGm)
protected

Prepare redrawing by setting dirty flags of all members of given natural group (obtained as pNGm->group() if !NULL).

INLINE float ZqZoom::getScaleFactor ( ) const
virtual

Get current scaling factor.

virtual float ZqZoom::getScaleFactor ( ) const
virtual

Get current scaling factor.

virtual ZoomMode ZqZoom::getZoomMode ( ) const
virtual

Get mode of zooming.

INLINE ZqZoom::ZoomMode ZqZoom::getZoomMode ( ) const
virtual

Get mode of zooming.

virtual ZqbEventHint ZqZoom::input ( QEvent &  event)
virtual

Switch mouse events processing depending the mode of the zoom.

Reimplemented from ZqRubberBox.

virtual ZqbEventHint ZqZoom::input ( QEvent &  event)
virtual

Switch mouse events processing depending the mode of the zoom.

Reimplemented from ZqRubberBox.

int ZqZoom::pos2nat ( const QPoint &  p,
double  nc[2] 
) const
protected

Convert given QPoint to pair of natural coordinates (both X and Y if possible; if not undefined value will take place). Return mask of two bits where the low one (1 << 0) designates presence of X and the high one (1 << 1) - presence of Y in returned result.

int ZqZoom::pos2nat ( const QPoint &  p,
double  nc[2] 
) const
protected

Convert given QPoint to pair of natural coordinates (both X and Y if possible; if not undefined value will take place). Return mask of two bits where the low one (1 << 0) designates presence of X and the high one (1 << 1) - presence of Y in returned result.

virtual void ZqZoom::setScaleFactor ( float  fScale)
virtual

Set scaling factor for zoom in/zoom out. To get expected behaviour the value should be >1.

INLINE void ZqZoom::setScaleFactor ( float  fScale)
virtual

Set scaling factor for zoom in/zoom out. To get expected behaviour the value should be >1.

INLINE void ZqZoom::setZoomMode ( ZqZoom::ZoomMode  eMode)
virtual

Set mode of zooming. Changing mode of zooming while processig input events may cause strange and unpredictable results. It's wise to setup zoom mode just after object creation and don't change it forever.

virtual void ZqZoom::setZoomMode ( ZoomMode  eMode)
virtual

Set mode of zooming. Changing mode of zooming while processig input events may cause strange and unpredictable results. It's wise to setup zoom mode just after object creation and don't change it forever.

virtual void ZqZoom::zoomAll ( )
virtual

Action of zooming the whole contents in preset bounds of natual group(s).

virtual void ZqZoom::zoomAll ( )
virtual

Action of zooming the whole contents in preset bounds of natual group(s).

virtual void ZqZoom::zoomClick ( float  sf,
double  nxy[2] = NULL 
)
virtual

Action of zooming in (or out, depending given scale factor) objects with natural group(s) by preset scale factor. Given natural coordinates are used as center of zooming. If NULL is passed instead of coordinates then current center of natural group coordinates is used.

virtual void ZqZoom::zoomClick ( float  sf,
double  nxy[2] = NULL 
)
virtual

Action of zooming in (or out, depending given scale factor) objects with natural group(s) by preset scale factor. Given natural coordinates are used as center of zooming. If NULL is passed instead of coordinates then current center of natural group coordinates is used.

void ZqZoom::zoomClick ( double  nc,
ZqbNatGroup group,
float  fScaleFactor 
)
protected

Zoom by given factor around given natural position in given natural group.

void ZqZoom::zoomClick ( double  nc,
ZqbNatGroup group,
float  fScaleFactor 
)
protected

Zoom by given factor around given natural position in given natural group.

Member Data Documentation

bool ZqZoom::m_bDragToMove
protected

Drag-to-move activity flag.

ZoomMode ZqZoom::m_eZoomMode
protected

Mode of zooming.

float ZqZoom::m_fScale
protected

Scaling factor.

ZqbNatGrpMember * ZqZoom::m_pNatX
protected

Horizontal natural group member or NULL if this dimension is not scaled.

ZqbNatGrpMember * ZqZoom::m_pNatY
protected

Vertical natural group member or NULL if this dimension is not scaled.


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