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

#include <zq_polygon.hpp>

Inheritance diagram for ZqPolygon:
ZqObject ZqObject ZqbVisible ZqbAutoName ZqbVisible ZqbAutoName ZqbVisible ZqbAutoName ZqbVisible ZqbAutoName

Public Member Functions

 ZqPolygon (ZqbNatGroup &rNatX, ZqbNatGroup &rNatY, const char *szName=NULL)
 
 ZqPolygon (ZqbNatGroup &rNatX, ZqbNatGroup &rNatY, ZqbPlaceholder *pPh, const char *szName=NULL)
 
virtual void setThickness (int iThickness)
 
virtual int getThickness () const
 
virtual void setLineColor (const QColor &qcLine)
 
virtual const QColor & getLineColor () const
 
virtual ZqbEventHint input (QEvent &event)
 
virtual void polygon (const ZqbNatPoints &vPolygon)
 
virtual void redraw (QPainter &paint)
 
 ZqPolygon (ZqbNatGroup &rNatX, ZqbNatGroup &rNatY, const char *szName=NULL)
 
 ZqPolygon (ZqbNatGroup &rNatX, ZqbNatGroup &rNatY, ZqbPlaceholder *pPh, const char *szName=NULL)
 
virtual void setThickness (int iThickness)
 
virtual int getThickness () const
 
virtual void setLineColor (const QColor &qcLine)
 
virtual const QColor & getLineColor () const
 
virtual ZqbEventHint input (QEvent &event)
 
virtual void polygon (const ZqbNatPoints &vPolygon)
 
virtual void redraw (QPainter &paint)
 
- 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 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 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 Attributes

ZqbNatGrpMember m_NatX
 
ZqbNatGrpMember m_NatY
 

Protected Member Functions

void drawPolyline (const QPointArray &ar)
 
void drawLine (const QPoint &p1, const QPoint &p2)
 
void erasePolyline ()
 
void eraseLastSegment ()
 
void drawPolyline (QPainter &paint, const QPolygon &ar)
 
void drawLine (QPainter &paint, const QPoint &p1, const QPoint &p2)
 
void erasePolyline ()
 
void eraseLastSegment ()
 

Protected Attributes

QPointArray m_arPoints
 
bool m_bDrawnPolyline
 
QPoint m_qLast
 
bool m_bDrawnLast
 
int m_iThickness
 
QColor m_qcLine
 
QPolygon m_arPoints
 
- 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

The object implements mouse-driven polygon selection with custom processing at the end of selection. The polygon is represented by vector of natural ("x" and "y") coordinates.

Constructor & Destructor Documentation

ZqPolygon::ZqPolygon ( ZqbNatGroup rNatX,
ZqbNatGroup rNatY,
const char *  szName = NULL 
)

Create named polygon selector without placement. One needs to attachPlace() to activate the object to process events and draw itself.

ZqPolygon::ZqPolygon ( ZqbNatGroup rNatX,
ZqbNatGroup rNatY,
ZqbPlaceholder pPh,
const char *  szName = NULL 
)

Create named polygon selector in given place.

ZqPolygon::ZqPolygon ( ZqbNatGroup rNatX,
ZqbNatGroup rNatY,
const char *  szName = NULL 
)

Create named polygon selector without placement. One needs to attachPlace() to activate the object to process events and draw itself.

ZqPolygon::ZqPolygon ( ZqbNatGroup rNatX,
ZqbNatGroup rNatY,
ZqbPlaceholder pPh,
const char *  szName = NULL 
)

Create named polygon selector in given place.

Member Function Documentation

void ZqPolygon::drawLine ( const QPoint &  p1,
const QPoint &  p2 
)
protected

Draw given line with custom attributes.

void ZqPolygon::drawLine ( QPainter &  paint,
const QPoint &  p1,
const QPoint &  p2 
)
protected

Draw given line with custom attributes.

void ZqPolygon::drawPolyline ( QPainter &  paint,
const QPolygon &  ar 
)
protected

Draw given polyline with custom attributes.

void ZqPolygon::drawPolyline ( const QPointArray &  ar)
protected

Draw given polyline with custom attributes.

INLINE void ZqPolygon::eraseLastSegment ( )
protected

Erase last segment.

void ZqPolygon::eraseLastSegment ( )
protected

Erase last segment.

INLINE void ZqPolygon::erasePolyline ( )
protected

Erase polyline.

void ZqPolygon::erasePolyline ( )
protected

Erase polyline.

INLINE const QColor & ZqPolygon::getLineColor ( ) const
virtual

Get color used for polyline drawing.

virtual const QColor& ZqPolygon::getLineColor ( ) const
virtual

Get color used for polyline drawing.

INLINE int ZqPolygon::getThickness ( ) const
virtual

Get thickness of the polyline.

virtual int ZqPolygon::getThickness ( ) const
virtual

Get thickness of the polyline.

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

General event processing method. Next mouse buttons mapping take place:

  • LeftButton - adds one point to polygon;
  • MiddleButton - completes the polygon and executes custom processing over the polygon;
  • RightButton - removes the previously added point.

Reimplemented from ZqObject.

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

General event processing method. Next mouse buttons mapping take place:

  • LeftButton - adds one point to polygon;
  • MiddleButton - completes the polygon and executes custom processing over the polygon;
  • RightButton - removes the previously added point.

Reimplemented from ZqObject.

virtual void ZqPolygon::polygon ( const ZqbNatPoints &  vPolygon)
virtual

Custom polygon processing procedure.

virtual void ZqPolygon::polygon ( const ZqbNatPoints &  vPolygon)
virtual

Custom polygon processing procedure.

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

General drawing method. It's used not for drawing but for switching off drawn flags.

Reimplemented from ZqObject.

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

General drawing method. It's used not for drawing but for switching off drawn flags.

Reimplemented from ZqObject.

INLINE void ZqPolygon::setLineColor ( const QColor &  qcLine)
virtual

Set color used for polyline drawing.

virtual void ZqPolygon::setLineColor ( const QColor &  qcLine)
virtual

Set color used for polyline drawing.

virtual void ZqPolygon::setThickness ( int  iThickness)
virtual

Set thickness of the polyline.

INLINE void ZqPolygon::setThickness ( int  iThickness)
virtual

Set thickness of the polyline.

Member Data Documentation

QPointArray ZqPolygon::m_arPoints
protected

Vector of pixel coordinate points. This is the whole polyline except for the last segment.

QPolygon ZqPolygon::m_arPoints
protected

Vector of pixel coordinate points. This is the whole polyline except for the last segment.

bool ZqPolygon::m_bDrawnLast
protected

Flag of drawn last segment of polygon. Since XorROP is used for drawing then drawn twice means erased.

bool ZqPolygon::m_bDrawnPolyline
protected

Flag of drawn polyline except for the last segment which is not fixed - it follows mouse point. Since XorROP is used for drawing then drawn twice means erased.

int ZqPolygon::m_iThickness
protected

Thickness of the polyline drawing.

ZqbNatGrpMember ZqPolygon::m_NatX

Natural coordinate for X axis.

ZqbNatGrpMember ZqPolygon::m_NatY

Natural coordinate for Y axis.

QColor ZqPolygon::m_qcLine
protected

Color for polyline drawing. Used in XOR bit painting mode.

QPoint ZqPolygon::m_qLast
protected

The previous point of the end of the last segment which follows the mosue pointer.


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