Computer Assited Medical Intervention Tool Kit  version 4.1
Classes | Macros | Typedefs | Functions
canvas_variant/qtcanvas.cpp File Reference
#include "qtcanvas.h"
#include <QtGui/QApplication>
#include <QtGui/QBitmap>
#include <QtGui/QDesktopWidget>
#include <QtGui/QImage>
#include <QtGui/QPainter>
#include <QtCore/QTimer>
#include <QtCore/qhash.h>
#include <QtCore/qset.h>
#include <QtCore/qalgorithms.h>
#include <QtGui/qevent.h>
#include <QtGui/qpainterpath.h>
#include <stdlib.h>

Classes

struct  _EdgeTableEntry
 
struct  _ScanLineList
 
struct  _ScanLineListBlock
 
struct  BRESINFO
 
struct  DDXPointRec
 
struct  EdgeTable
 
class  QPolygonalProcessor
 
class  QtCanvasChunk
 
class  QtCanvasClusterizer
 
class  QtCanvasData
 
class  QtCanvasItemExtra
 
class  QtCanvasItemLess
 
class  QtCanvasPolygonScanner
 
class  QtCanvasViewData
 
class  QtCanvasWidget
 
class  QtPolygonScanner
 

Macros

#define BRESINCRPGON(d, minval, m, m1, incr1, incr2)
 
#define BRESINCRPGONSTRUCT(bres)   BRESINCRPGON(bres.d, bres.minor, bres.m, bres.m1, bres.incr1, bres.incr2)
 
#define BRESINITPGON(dy, x1, x2, xStart, d, m, m1, incr1, incr2)
 
#define BRESINITPGONSTRUCT(dmaj, min1, min2, bres)
 
#define EVALUATEEDGEEVENODD(pAET, pPrevAET, y)
 
#define EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET)
 
#define MAXINT   0x7fffffff
 
#define MININT   -MAXINT
 
#define NUMPTSTOBUFFER   200
 
#define SLLSPERBLOCK   25
 

Typedefs

typedef struct DDXPointRecDDXPointPtr
 
typedef struct _EdgeTableEntry EdgeTableEntry
 
typedef struct _ScanLineList ScanLineList
 
typedef struct _ScanLineListBlock ScanLineListBlock
 

Functions

static bool collision_double_dispatch (const QtCanvasSprite *s1, const QtCanvasPolygonalItem *p1, const QtCanvasRectangle *r1, const QtCanvasEllipse *e1, const QtCanvasText *t1, const QtCanvasSprite *s2, const QtCanvasPolygonalItem *p2, const QtCanvasRectangle *r2, const QtCanvasEllipse *e2, const QtCanvasText *t2)
 
static const QBrush & defaultPolygonBrush ()
 
static const QPen & defaultPolygonPen ()
 
static int gcd (int a, int b)
 
static void include (QRect &r, const QRect &rect)
 
static void micomputeWAET (EdgeTableEntry *AET)
 
static bool miCreateETandAET (int count, DDXPointPtr pts, EdgeTable *ET, EdgeTableEntry *AET, EdgeTableEntry *pETEs, ScanLineListBlock *pSLLBlock)
 
static void miFreeStorage (ScanLineListBlock *pSLLBlock)
 
static bool miInsertEdgeInET (EdgeTable *ET, EdgeTableEntry *ETE, int scanline, ScanLineListBlock **SLLBlock, int *iSLLBlock)
 
static int miInsertionSort (EdgeTableEntry *AET)
 
static void miloadAET (EdgeTableEntry *AET, EdgeTableEntry *ETEs)
 
bool qt_testCollision (const QtCanvasSprite *s1, const QtCanvasSprite *s2)
 
static int scm (int a, int b)
 

Macro Definition Documentation

◆ BRESINCRPGON

#define BRESINCRPGON (   d,
  minval,
  m,
  m1,
  incr1,
  incr2 
)
Value:
{ \
if (m1 > 0) { \
if (d > 0) { \
minval += m1; \
d += incr1; \
} \
else { \
minval += m; \
d += incr2; \
} \
} else {\
if (d >= 0) { \
minval += m1; \
d += incr1; \
} \
else { \
minval += m; \
d += incr2; \
} \
} \
}

◆ BRESINCRPGONSTRUCT

#define BRESINCRPGONSTRUCT (   bres)    BRESINCRPGON(bres.d, bres.minor, bres.m, bres.m1, bres.incr1, bres.incr2)

◆ BRESINITPGON

#define BRESINITPGON (   dy,
  x1,
  x2,
  xStart,
  d,
  m,
  m1,
  incr1,
  incr2 
)
Value:
{ \
int dx; /* local storage */ \
\
/* \
* if the edge is horizontal, then it is ignored \
* and assumed not to be processed. Otherwise, do this stuff. \
*/ \
if ((dy) != 0) { \
xStart = (x1); \
dx = (x2) - xStart; \
if (dx < 0) { \
m = dx / (dy); \
m1 = m - 1; \
incr1 = -2 * dx + 2 * (dy) * m1; \
incr2 = -2 * dx + 2 * (dy) * m; \
d = 2 * m * (dy) - 2 * dx - 2 * (dy); \
} else { \
m = dx / (dy); \
m1 = m + 1; \
incr1 = 2 * dx - 2 * (dy) * m1; \
incr2 = 2 * dx - 2 * (dy) * m; \
d = -2 * m * (dy) + 2 * dx; \
} \
} \
}

◆ BRESINITPGONSTRUCT

#define BRESINITPGONSTRUCT (   dmaj,
  min1,
  min2,
  bres 
)
Value:
BRESINITPGON(dmaj, min1, min2, bres.minor, bres.d, \
bres.m, bres.m1, bres.incr1, bres.incr2)
#define BRESINITPGON(dy, x1, x2, xStart, d, m, m1, incr1, incr2)
Definition: canvas_variant/qtcanvas.cpp:5019

Referenced by miCreateETandAET().

◆ EVALUATEEDGEEVENODD

#define EVALUATEEDGEEVENODD (   pAET,
  pPrevAET,
 
)
Value:
{ \
if (pAET->ymax == y) { /* leaving this edge */ \
pPrevAET->next = pAET->next; \
pAET = pPrevAET->next; \
if (pAET) \
pAET->back = pPrevAET; \
} \
else { \
BRESINCRPGONSTRUCT(pAET->bres) \
pPrevAET = pAET; \
pAET = pAET->next; \
} \
}

Referenced by miInsertionSort().

◆ EVALUATEEDGEWINDING

#define EVALUATEEDGEWINDING (   pAET,
  pPrevAET,
  y,
  fixWAET 
)
Value:
{ \
if (pAET->ymax == y) { /* leaving this edge */ \
pPrevAET->next = pAET->next; \
pAET = pPrevAET->next; \
fixWAET = 1; \
if (pAET) \
pAET->back = pPrevAET; \
} \
else { \
BRESINCRPGONSTRUCT(pAET->bres); \
pPrevAET = pAET; \
pAET = pAET->next; \
} \
}

Referenced by miInsertionSort().

◆ MAXINT

#define MAXINT   0x7fffffff

Referenced by miCreateETandAET().

◆ MININT

#define MININT   -MAXINT

Referenced by miCreateETandAET().

◆ NUMPTSTOBUFFER

#define NUMPTSTOBUFFER   200

Referenced by miInsertionSort().

◆ SLLSPERBLOCK

#define SLLSPERBLOCK   25

Referenced by miInsertEdgeInET().

Typedef Documentation

◆ DDXPointPtr

typedef struct DDXPointRec * DDXPointPtr

◆ EdgeTableEntry

◆ ScanLineList

typedef struct _ScanLineList ScanLineList

◆ ScanLineListBlock

Function Documentation

◆ collision_double_dispatch()

static bool collision_double_dispatch ( const QtCanvasSprite s1,
const QtCanvasPolygonalItem p1,
const QtCanvasRectangle r1,
const QtCanvasEllipse e1,
const QtCanvasText t1,
const QtCanvasSprite s2,
const QtCanvasPolygonalItem p2,
const QtCanvasRectangle r2,
const QtCanvasEllipse e2,
const QtCanvasText t2 
)
static

References QtCanvas::addItemToChunk(), QtCanvasItem::addToChunks(), QtCanvasSprite::addToChunks(), QtCanvasEllipse::angleLength(), QtCanvasPolygonalItem::areaPointsAdvanced(), QtCanvasSprite::bottomEdge(), QtCanvasItem::boundingRect(), QtCanvasSprite::boundingRect(), QtCanvasItem::boundingRectAdvanced(), QtCanvasItem::canvas(), QtCanvasItem::changeChunks(), QtCanvasItem::chunks(), QtCanvas::chunkSize(), QtCanvasItem::collidesWith(), QtCanvasSprite::collidesWith(), QtCanvasPolygonalItem::collidesWith(), QtCanvasRectangle::collidesWith(), QtCanvasEllipse::collidesWith(), QtCanvasText::collidesWith(), QtCanvasItem::collisions(), QtCanvas::collisions(), QtCanvasSprite::draw(), QtCanvasSprite::height(), QtCanvasEllipse::height(), QtCanvasSprite::imageAdvanced(), QtCanvasPixmap::init(), QtCanvasPixmapArray::isValid(), QtCanvasItem::isVisible(), QtCanvasSprite::leftEdge(), QtCanvasPixmapArray::operator!(), qt_testCollision(), QtCanvasPixmap::QtCanvasPixmap(), QtCanvasPixmapArray::QtCanvasPixmapArray(), QtCanvasPixmapArray::readCollisionMasks(), QtCanvasPixmapArray::readPixmaps(), QtCanvasItem::removeFromChunks(), QtCanvasSprite::removeFromChunks(), QtCanvas::removeItemFromChunk(), QtCanvasPixmapArray::reset(), QtCanvasSprite::rightEdge(), QtCanvas::setChangedChunk(), QtCanvasPixmapArray::setImage(), QtCanvasPolygonalItem::setPen(), QtCanvasItem::show(), QtCanvasSprite::topEdge(), QtCanvasItem::val, QtCanvasSprite::width(), QtCanvasEllipse::width(), QtCanvasItem::x(), QtCanvasItem::xVelocity(), QtCanvasItem::y(), QtCanvasItem::yVelocity(), QtCanvasPixmap::~QtCanvasPixmap(), and QtCanvasPixmapArray::~QtCanvasPixmapArray().

◆ defaultPolygonBrush()

static const QBrush& defaultPolygonBrush ( )
static

◆ defaultPolygonPen()

static const QPen& defaultPolygonPen ( )
static

Referenced by defaultPolygonBrush().

◆ gcd()

static int gcd ( int  a,
int  b 
)
static

Referenced by scm().

◆ include()

static void include ( QRect &  r,
const QRect &  rect 
)
static

◆ micomputeWAET()

static void micomputeWAET ( EdgeTableEntry AET)
static

◆ miCreateETandAET()

static bool miCreateETandAET ( int  count,
DDXPointPtr  pts,
EdgeTable ET,
EdgeTableEntry AET,
EdgeTableEntry pETEs,
ScanLineListBlock pSLLBlock 
)
static

◆ miFreeStorage()

static void miFreeStorage ( ScanLineListBlock pSLLBlock)
static

◆ miInsertEdgeInET()

static bool miInsertEdgeInET ( EdgeTable ET,
EdgeTableEntry ETE,
int  scanline,
ScanLineListBlock **  SLLBlock,
int *  iSLLBlock 
)
static

◆ miInsertionSort()

static int miInsertionSort ( EdgeTableEntry AET)
static

◆ miloadAET()

static void miloadAET ( EdgeTableEntry AET,
EdgeTableEntry ETEs 
)
static

◆ qt_testCollision()

bool qt_testCollision ( const QtCanvasSprite s1,
const QtCanvasSprite s2 
)

◆ scm()

static int scm ( int  a,
int  b 
)
static