Computer Assited Medical Intervention Tool Kit  version 4.1
Public Slots | Signals | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
QtCanvas Class Reference

#include <qtcanvas.h>

Inherits QObject, and QObject.

Public Slots

virtual void advance ()
 
virtual void advance ()
 
virtual void update ()
 
virtual void update ()
 

Signals

void resized ()
 
void resized ()
 

Public Member Functions

virtual void addAnimation (QtCanvasItem *)
 
virtual void addAnimation (QtCanvasItem *)
 
virtual void addItem (QtCanvasItem *)
 
virtual void addItem (QtCanvasItem *)
 
void addItemToChunk (QtCanvasItem *, int i, int j)
 
void addItemToChunk (QtCanvasItem *, int i, int j)
 
void addItemToChunkContaining (QtCanvasItem *, int x, int y)
 
void addItemToChunkContaining (QtCanvasItem *, int x, int y)
 
virtual void addView (QtCanvasView *)
 
virtual void addView (QtCanvasView *)
 
QtCanvasItemList allItems ()
 
QtCanvasItemList allItems ()
 
QColor backgroundColor () const
 
QColor backgroundColor () const
 
QPixmap backgroundPixmap () const
 
QPixmap backgroundPixmap () const
 
int chunkSize () const
 
int chunkSize () const
 
QtCanvasItemList collisions (const QPoint &) const
 
QtCanvasItemList collisions (const QPoint &) const
 
QtCanvasItemList collisions (const QRect &) const
 
QtCanvasItemList collisions (const QRect &) const
 
QtCanvasItemList collisions (const QPolygon &pa, const QtCanvasItem *item, bool exact) const
 
QtCanvasItemList collisions (const QPolygon &pa, const QtCanvasItem *item, bool exact) const
 
void drawArea (const QRect &, QPainter *p, bool double_buffer=false)
 
void drawArea (const QRect &, QPainter *p, bool double_buffer=false)
 
void drawCanvasArea (const QRect &, QPainter *p=0, bool double_buffer=true)
 
void drawCanvasArea (const QRect &, QPainter *p=0, bool double_buffer=true)
 
void drawViewArea (QtCanvasView *view, QPainter *p, const QRect &r, bool dbuf)
 
void drawViewArea (QtCanvasView *view, QPainter *p, const QRect &r, bool dbuf)
 
int height () const
 
int height () const
 
bool onCanvas (int x, int y) const
 
bool onCanvas (int x, int y) const
 
bool onCanvas (const QPoint &p) const
 
bool onCanvas (const QPoint &p) const
 
 QtCanvas (QObject *parent=0)
 
 QtCanvas (QObject *parent=0)
 
 QtCanvas (int w, int h)
 
 QtCanvas (int w, int h)
 
 QtCanvas (QPixmap p, int h, int v, int tilewidth, int tileheight)
 
 QtCanvas (QPixmap p, int h, int v, int tilewidth, int tileheight)
 
QRect rect () const
 
QRect rect () const
 
virtual void removeAnimation (QtCanvasItem *)
 
virtual void removeAnimation (QtCanvasItem *)
 
virtual void removeItem (QtCanvasItem *)
 
virtual void removeItem (QtCanvasItem *)
 
void removeItemFromChunk (QtCanvasItem *, int i, int j)
 
void removeItemFromChunk (QtCanvasItem *, int i, int j)
 
void removeItemFromChunkContaining (QtCanvasItem *, int x, int y)
 
void removeItemFromChunkContaining (QtCanvasItem *, int x, int y)
 
virtual void removeView (QtCanvasView *)
 
virtual void removeView (QtCanvasView *)
 
virtual void resize (int width, int height)
 
virtual void resize (int width, int height)
 
virtual void retune (int chunksize, int maxclusters=100)
 
virtual void retune (int chunksize, int maxclusters=100)
 
bool sameChunk (int x1, int y1, int x2, int y2) const
 
bool sameChunk (int x1, int y1, int x2, int y2) const
 
virtual void setAdvancePeriod (int ms)
 
virtual void setAdvancePeriod (int ms)
 
virtual void setAllChanged ()
 
virtual void setAllChanged ()
 
virtual void setBackgroundColor (const QColor &c)
 
virtual void setBackgroundColor (const QColor &c)
 
virtual void setBackgroundPixmap (const QPixmap &p)
 
virtual void setBackgroundPixmap (const QPixmap &p)
 
virtual void setChanged (const QRect &area)
 
virtual void setChanged (const QRect &area)
 
virtual void setChangedChunk (int i, int j)
 
virtual void setChangedChunk (int i, int j)
 
virtual void setChangedChunkContaining (int x, int y)
 
virtual void setChangedChunkContaining (int x, int y)
 
virtual void setTile (int x, int y, int tilenum)
 
virtual void setTile (int x, int y, int tilenum)
 
virtual void setTiles (QPixmap tiles, int h, int v, int tilewidth, int tileheight)
 
virtual void setTiles (QPixmap tiles, int h, int v, int tilewidth, int tileheight)
 
virtual void setUnchanged (const QRect &area)
 
virtual void setUnchanged (const QRect &area)
 
virtual void setUpdatePeriod (int ms)
 
virtual void setUpdatePeriod (int ms)
 
QSize size () const
 
QSize size () const
 
int tile (int x, int y) const
 
int tile (int x, int y) const
 
int tileHeight () const
 
int tileHeight () const
 
int tilesHorizontally () const
 
int tilesHorizontally () const
 
int tilesVertically () const
 
int tilesVertically () const
 
int tileWidth () const
 
int tileWidth () const
 
bool validChunk (int x, int y) const
 
bool validChunk (int x, int y) const
 
bool validChunk (const QPoint &p) const
 
bool validChunk (const QPoint &p) const
 
int width () const
 
int width () const
 
virtual ~QtCanvas ()
 
virtual ~QtCanvas ()
 

Protected Member Functions

virtual void drawBackground (QPainter &, const QRect &area)
 
virtual void drawBackground (QPainter &, const QRect &area)
 
virtual void drawForeground (QPainter &, const QRect &area)
 
virtual void drawForeground (QPainter &, const QRect &area)
 

Private Member Functions

QRect changeBounds ()
 
QRect changeBounds ()
 
QtCanvasChunkchunk (int i, int j) const
 
QtCanvasChunkchunk (int i, int j) const
 
QtCanvasChunkchunkContaining (int x, int y) const
 
QtCanvasChunkchunkContaining (int x, int y) const
 
void init (int w, int h, int chunksze=16, int maxclust=100)
 
void init (int w, int h, int chunksze=16, int maxclust=100)
 
void initTiles (QPixmap p, int h, int v, int tilewidth, int tileheight)
 
void initTiles (QPixmap p, int h, int v, int tilewidth, int tileheight)
 

Private Attributes

int aheight
 
int awidth
 
QColor bgcolor
 
int chheight
 
QtCanvasChunkchunks
 
int chunksize
 
int chwidth
 
QtCanvasDatad
 
bool debug_redraw_areas
 
ushort * grid
 
ushort htiles
 
int maxclusters
 
bool oneone
 
QPixmap pm
 
ushort tileh
 
ushort tilew
 
QTimer * update_timer
 
ushort vtiles
 

Friends

void qt_unview (QtCanvas *c)
 
void qt_unview (QtCanvas *c)
 

Constructor & Destructor Documentation

◆ QtCanvas() [1/6]

QtCanvas::QtCanvas ( QObject *  parent = 0)

References init().

Referenced by scm().

◆ QtCanvas() [2/6]

QtCanvas::QtCanvas ( int  w,
int  h 
)

References init().

◆ QtCanvas() [3/6]

QtCanvas::QtCanvas ( QPixmap  p,
int  h,
int  v,
int  tilewidth,
int  tileheight 
)

References init(), scm(), and setTiles().

◆ ~QtCanvas() [1/2]

QtCanvas::~QtCanvas ( )
virtual

References allItems(), chunks, d, grid, and QtCanvasData::viewList.

Referenced by scm().

◆ QtCanvas() [4/6]

QtCanvas::QtCanvas ( QObject *  parent = 0)

◆ QtCanvas() [5/6]

QtCanvas::QtCanvas ( int  w,
int  h 
)

◆ QtCanvas() [6/6]

QtCanvas::QtCanvas ( QPixmap  p,
int  h,
int  v,
int  tilewidth,
int  tileheight 
)

◆ ~QtCanvas() [2/2]

virtual QtCanvas::~QtCanvas ( )
virtual

Member Function Documentation

◆ addAnimation() [1/2]

void QtCanvas::addAnimation ( QtCanvasItem item)
virtual

◆ addAnimation() [2/2]

virtual void QtCanvas::addAnimation ( QtCanvasItem )
virtual

◆ addItem() [1/2]

void QtCanvas::addItem ( QtCanvasItem item)
virtual

◆ addItem() [2/2]

virtual void QtCanvas::addItem ( QtCanvasItem )
virtual

◆ addItemToChunk() [1/2]

void QtCanvas::addItemToChunk ( QtCanvasItem g,
int  i,
int  j 
)

◆ addItemToChunk() [2/2]

void QtCanvas::addItemToChunk ( QtCanvasItem ,
int  i,
int  j 
)

◆ addItemToChunkContaining() [1/2]

void QtCanvas::addItemToChunkContaining ( QtCanvasItem ,
int  x,
int  y 
)

◆ addItemToChunkContaining() [2/2]

void QtCanvas::addItemToChunkContaining ( QtCanvasItem g,
int  x,
int  y 
)

References QtCanvasChunk::add(), chunkContaining(), height(), and width().

Referenced by scm().

◆ addView() [1/2]

void QtCanvas::addView ( QtCanvasView view)
virtual

◆ addView() [2/2]

virtual void QtCanvas::addView ( QtCanvasView )
virtual

◆ advance [1/2]

void QtCanvas::advance ( )
virtualslot

◆ advance [2/2]

virtual void QtCanvas::advance ( )
virtualslot

◆ allItems() [1/2]

QtCanvasItemList QtCanvas::allItems ( )

References d, and QtCanvasData::itemDict.

Referenced by MainWindow::clearAll(), scm(), and ~QtCanvas().

◆ allItems() [2/2]

QtCanvasItemList QtCanvas::allItems ( )

◆ backgroundColor() [1/2]

QColor QtCanvas::backgroundColor ( ) const

References bgcolor.

Referenced by addView(), and scm().

◆ backgroundColor() [2/2]

QColor QtCanvas::backgroundColor ( ) const

◆ backgroundPixmap() [1/2]

QPixmap QtCanvas::backgroundPixmap ( ) const

References pm.

Referenced by scm().

◆ backgroundPixmap() [2/2]

QPixmap QtCanvas::backgroundPixmap ( ) const

◆ changeBounds() [1/2]

QRect QtCanvas::changeBounds ( )
private

◆ changeBounds() [2/2]

QRect QtCanvas::changeBounds ( )
private

◆ chunk() [1/2]

QtCanvasChunk & QtCanvas::chunk ( int  i,
int  j 
) const
private

◆ chunk() [2/2]

QtCanvasChunk& QtCanvas::chunk ( int  i,
int  j 
) const
private

◆ chunkContaining() [1/2]

QtCanvasChunk & QtCanvas::chunkContaining ( int  x,
int  y 
) const
private

◆ chunkContaining() [2/2]

QtCanvasChunk& QtCanvas::chunkContaining ( int  x,
int  y 
) const
private

◆ chunkSize() [1/2]

int QtCanvas::chunkSize ( ) const
inline

◆ chunkSize() [2/2]

int QtCanvas::chunkSize ( ) const
inline

◆ collisions() [1/6]

QtCanvasItemList QtCanvas::collisions ( const QPoint &  p) const

◆ collisions() [2/6]

QtCanvasItemList QtCanvas::collisions ( const QPoint &  ) const

◆ collisions() [3/6]

QtCanvasItemList QtCanvas::collisions ( const QRect &  r) const

◆ collisions() [4/6]

QtCanvasItemList QtCanvas::collisions ( const QRect &  ) const

◆ collisions() [5/6]

QtCanvasItemList QtCanvas::collisions ( const QPolygon &  pa,
const QtCanvasItem item,
bool  exact 
) const

◆ collisions() [6/6]

QtCanvasItemList QtCanvas::collisions ( const QPolygon &  pa,
const QtCanvasItem item,
bool  exact 
) const

◆ drawArea() [1/2]

void QtCanvas::drawArea ( const QRect &  clip,
QPainter *  p,
bool  double_buffer = false 
)

References drawCanvasArea().

Referenced by scm().

◆ drawArea() [2/2]

void QtCanvas::drawArea ( const QRect &  ,
QPainter *  p,
bool  double_buffer = false 
)

◆ drawBackground() [1/2]

void QtCanvas::drawBackground ( QPainter &  painter,
const QRect &  area 
)
protectedvirtual

◆ drawBackground() [2/2]

virtual void QtCanvas::drawBackground ( QPainter &  ,
const QRect &  area 
)
protectedvirtual

◆ drawCanvasArea() [1/2]

void QtCanvas::drawCanvasArea ( const QRect &  inarea,
QPainter *  p = 0,
bool  double_buffer = true 
)

◆ drawCanvasArea() [2/2]

void QtCanvas::drawCanvasArea ( const QRect &  ,
QPainter *  p = 0,
bool  double_buffer = true 
)

◆ drawForeground() [1/2]

virtual void QtCanvas::drawForeground ( QPainter &  ,
const QRect &  area 
)
protectedvirtual

◆ drawForeground() [2/2]

void QtCanvas::drawForeground ( QPainter &  painter,
const QRect &  area 
)
protectedvirtual

References debug_redraw_areas.

Referenced by drawCanvasArea(), and scm().

◆ drawViewArea() [1/2]

void QtCanvas::drawViewArea ( QtCanvasView view,
QPainter *  p,
const QRect &  r,
bool  dbuf 
)

◆ drawViewArea() [2/2]

void QtCanvas::drawViewArea ( QtCanvasView view,
QPainter *  p,
const QRect &  r,
bool  dbuf 
)

◆ height() [1/2]

int QtCanvas::height ( ) const
inline

◆ height() [2/2]

int QtCanvas::height ( ) const
inline

◆ init() [1/2]

void QtCanvas::init ( int  w,
int  h,
int  chunksze = 16,
int  maxclust = 100 
)
private

◆ init() [2/2]

void QtCanvas::init ( int  w,
int  h,
int  chunksze = 16,
int  maxclust = 100 
)
private

Referenced by QtCanvas(), and scm().

◆ initTiles() [1/2]

void QtCanvas::initTiles ( QPixmap  p,
int  h,
int  v,
int  tilewidth,
int  tileheight 
)
private

◆ initTiles() [2/2]

void QtCanvas::initTiles ( QPixmap  p,
int  h,
int  v,
int  tilewidth,
int  tileheight 
)
private

◆ onCanvas() [1/4]

bool QtCanvas::onCanvas ( int  x,
int  y 
) const
inline

◆ onCanvas() [2/4]

bool QtCanvas::onCanvas ( int  x,
int  y 
) const
inline

◆ onCanvas() [3/4]

bool QtCanvas::onCanvas ( const QPoint &  p) const
inline

◆ onCanvas() [4/4]

bool QtCanvas::onCanvas ( const QPoint &  p) const
inline

◆ rect() [1/2]

QRect QtCanvas::rect ( ) const
inline

◆ rect() [2/2]

QRect QtCanvas::rect ( ) const
inline

◆ removeAnimation() [1/2]

void QtCanvas::removeAnimation ( QtCanvasItem item)
virtual

◆ removeAnimation() [2/2]

virtual void QtCanvas::removeAnimation ( QtCanvasItem )
virtual

◆ removeItem() [1/2]

void QtCanvas::removeItem ( QtCanvasItem item)
virtual

◆ removeItem() [2/2]

virtual void QtCanvas::removeItem ( QtCanvasItem )
virtual

◆ removeItemFromChunk() [1/2]

void QtCanvas::removeItemFromChunk ( QtCanvasItem ,
int  i,
int  j 
)

◆ removeItemFromChunk() [2/2]

void QtCanvas::removeItemFromChunk ( QtCanvasItem g,
int  i,
int  j 
)

◆ removeItemFromChunkContaining() [1/2]

void QtCanvas::removeItemFromChunkContaining ( QtCanvasItem g,
int  x,
int  y 
)

References chunkContaining(), height(), QtCanvasChunk::remove(), and width().

Referenced by scm().

◆ removeItemFromChunkContaining() [2/2]

void QtCanvas::removeItemFromChunkContaining ( QtCanvasItem ,
int  x,
int  y 
)

◆ removeView() [1/2]

void QtCanvas::removeView ( QtCanvasView view)
virtual

References d, and QtCanvasData::viewList.

Referenced by scm(), and QtCanvasView::setCanvas().

◆ removeView() [2/2]

virtual void QtCanvas::removeView ( QtCanvasView )
virtual

◆ resize() [1/2]

virtual void QtCanvas::resize ( int  width,
int  height 
)
virtual

◆ resize() [2/2]

void QtCanvas::resize ( int  width,
int  height 
)
virtual

◆ resized [1/2]

void QtCanvas::resized ( )
signal

◆ resized [2/2]

void QtCanvas::resized ( )
signal

Referenced by resize().

◆ retune() [1/2]

void QtCanvas::retune ( int  chunksize,
int  maxclusters = 100 
)
virtual

◆ retune() [2/2]

virtual void QtCanvas::retune ( int  chunksize,
int  maxclusters = 100 
)
virtual

◆ sameChunk() [1/2]

bool QtCanvas::sameChunk ( int  x1,
int  y1,
int  x2,
int  y2 
) const
inline

◆ sameChunk() [2/2]

bool QtCanvas::sameChunk ( int  x1,
int  y1,
int  x2,
int  y2 
) const
inline

◆ setAdvancePeriod() [1/2]

virtual void QtCanvas::setAdvancePeriod ( int  ms)
virtual

◆ setAdvancePeriod() [2/2]

void QtCanvas::setAdvancePeriod ( int  ms)
virtual

References advance(), and update_timer.

Referenced by scm().

◆ setAllChanged() [1/2]

virtual void QtCanvas::setAllChanged ( )
virtual

◆ setAllChanged() [2/2]

void QtCanvas::setAllChanged ( )
virtual

References height(), setChanged(), and width().

Referenced by resize(), scm(), setBackgroundColor(), and setTiles().

◆ setBackgroundColor() [1/2]

void QtCanvas::setBackgroundColor ( const QColor &  c)
virtual

References bgcolor, d, setAllChanged(), and QtCanvasData::viewList.

Referenced by scm().

◆ setBackgroundColor() [2/2]

virtual void QtCanvas::setBackgroundColor ( const QColor &  c)
virtual

◆ setBackgroundPixmap() [1/2]

void QtCanvas::setBackgroundPixmap ( const QPixmap &  p)
virtual

References d, setTiles(), and QtCanvasData::viewList.

Referenced by scm().

◆ setBackgroundPixmap() [2/2]

virtual void QtCanvas::setBackgroundPixmap ( const QPixmap &  p)
virtual

◆ setChanged() [1/2]

virtual void QtCanvas::setChanged ( const QRect &  area)
virtual

◆ setChanged() [2/2]

void QtCanvas::setChanged ( const QRect &  area)
virtual

◆ setChangedChunk() [1/2]

virtual void QtCanvas::setChangedChunk ( int  i,
int  j 
)
virtual

◆ setChangedChunk() [2/2]

void QtCanvas::setChangedChunk ( int  i,
int  j 
)
virtual

◆ setChangedChunkContaining() [1/2]

void QtCanvas::setChangedChunkContaining ( int  x,
int  y 
)
virtual

◆ setChangedChunkContaining() [2/2]

virtual void QtCanvas::setChangedChunkContaining ( int  x,
int  y 
)
virtual

◆ setTile() [1/2]

void QtCanvas::setTile ( int  x,
int  y,
int  tilenum 
)
virtual

References chunksize, grid, htiles, setChanged(), setChangedChunk(), tileh, and tilew.

Referenced by scm().

◆ setTile() [2/2]

virtual void QtCanvas::setTile ( int  x,
int  y,
int  tilenum 
)
virtual

◆ setTiles() [1/2]

void QtCanvas::setTiles ( QPixmap  tiles,
int  h,
int  v,
int  tilewidth,
int  tileheight 
)
virtual

◆ setTiles() [2/2]

virtual void QtCanvas::setTiles ( QPixmap  tiles,
int  h,
int  v,
int  tilewidth,
int  tileheight 
)
virtual

◆ setUnchanged() [1/2]

virtual void QtCanvas::setUnchanged ( const QRect &  area)
virtual

◆ setUnchanged() [2/2]

void QtCanvas::setUnchanged ( const QRect &  area)
virtual

◆ setUpdatePeriod() [1/2]

virtual void QtCanvas::setUpdatePeriod ( int  ms)
virtual

◆ setUpdatePeriod() [2/2]

void QtCanvas::setUpdatePeriod ( int  ms)
virtual

References update(), and update_timer.

Referenced by scm().

◆ size() [1/2]

QSize QtCanvas::size ( ) const
inline

◆ size() [2/2]

QSize QtCanvas::size ( ) const
inline

◆ tile() [1/2]

int QtCanvas::tile ( int  x,
int  y 
) const
inline

◆ tile() [2/2]

int QtCanvas::tile ( int  x,
int  y 
) const
inline

Referenced by drawBackground().

◆ tileHeight() [1/2]

int QtCanvas::tileHeight ( ) const
inline

◆ tileHeight() [2/2]

int QtCanvas::tileHeight ( ) const
inline

◆ tilesHorizontally() [1/2]

int QtCanvas::tilesHorizontally ( ) const
inline

◆ tilesHorizontally() [2/2]

int QtCanvas::tilesHorizontally ( ) const
inline

Referenced by drawBackground().

◆ tilesVertically() [1/2]

int QtCanvas::tilesVertically ( ) const
inline

Referenced by drawBackground().

◆ tilesVertically() [2/2]

int QtCanvas::tilesVertically ( ) const
inline

◆ tileWidth() [1/2]

int QtCanvas::tileWidth ( ) const
inline

◆ tileWidth() [2/2]

int QtCanvas::tileWidth ( ) const
inline

◆ update [1/2]

virtual void QtCanvas::update ( )
virtualslot

◆ update [2/2]

void QtCanvas::update ( )
virtualslot

◆ validChunk() [1/4]

bool QtCanvas::validChunk ( int  x,
int  y 
) const
inline

◆ validChunk() [2/4]

bool QtCanvas::validChunk ( int  x,
int  y 
) const
inline

◆ validChunk() [3/4]

bool QtCanvas::validChunk ( const QPoint &  p) const
inline

◆ validChunk() [4/4]

bool QtCanvas::validChunk ( const QPoint &  p) const
inline

◆ width() [1/2]

int QtCanvas::width ( ) const
inline

◆ width() [2/2]

int QtCanvas::width ( ) const
inline

Friends And Related Function Documentation

◆ qt_unview [1/2]

void qt_unview ( QtCanvas c)
friend

◆ qt_unview [2/2]

void qt_unview ( QtCanvas c)
friend

Member Data Documentation

◆ aheight

int QtCanvas::aheight
private

Referenced by resize(), and retune().

◆ awidth

int QtCanvas::awidth
private

Referenced by resize(), and retune().

◆ bgcolor

QColor QtCanvas::bgcolor
private

◆ chheight

int QtCanvas::chheight
private

◆ chunks

QtCanvasChunk * QtCanvas::chunks
private

Referenced by chunk(), resize(), retune(), and ~QtCanvas().

◆ chunksize

int QtCanvas::chunksize
private

◆ chwidth

int QtCanvas::chwidth
private

◆ d

QtCanvasData * QtCanvas::d
private

◆ debug_redraw_areas

bool QtCanvas::debug_redraw_areas
private

Referenced by drawForeground().

◆ grid

ushort * QtCanvas::grid
private

◆ htiles

ushort QtCanvas::htiles
private

Referenced by addView(), setTile(), and setTiles().

◆ maxclusters

int QtCanvas::maxclusters
private

Referenced by retune().

◆ oneone

bool QtCanvas::oneone
private

◆ pm

QPixmap QtCanvas::pm
private

◆ tileh

ushort QtCanvas::tileh
private

Referenced by drawBackground(), setTile(), and setTiles().

◆ tilew

ushort QtCanvas::tilew
private

Referenced by drawBackground(), setTile(), and setTiles().

◆ update_timer

QTimer * QtCanvas::update_timer
private

◆ vtiles

ushort QtCanvas::vtiles
private

Referenced by addView(), and setTiles().


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