Computer Assited Medical Intervention Tool Kit  version 5.0
QtCanvasSprite Class Reference

#include <qtcanvas.h>

+ Inheritance diagram for QtCanvasSprite:
+ Collaboration diagram for QtCanvasSprite:

Public Types

enum  FrameAnimationType { Cycle, Oscillate, Cycle, Oscillate }
 
enum  FrameAnimationType { Cycle, Oscillate, Cycle, Oscillate }
 
- Public Types inherited from QtCanvasItem
enum  RttiValues {
  Rtti_Item = 0, Rtti_Sprite = 1, Rtti_PolygonalItem = 2, Rtti_Text = 3,
  Rtti_Polygon = 4, Rtti_Rectangle = 5, Rtti_Ellipse = 6, Rtti_Line = 7,
  Rtti_Spline = 8, Rtti_Item = 0, Rtti_Sprite = 1, Rtti_PolygonalItem = 2,
  Rtti_Text = 3, Rtti_Polygon = 4, Rtti_Rectangle = 5, Rtti_Ellipse = 6,
  Rtti_Line = 7, Rtti_Spline = 8
}
 
enum  RttiValues {
  Rtti_Item = 0, Rtti_Sprite = 1, Rtti_PolygonalItem = 2, Rtti_Text = 3,
  Rtti_Polygon = 4, Rtti_Rectangle = 5, Rtti_Ellipse = 6, Rtti_Line = 7,
  Rtti_Spline = 8, Rtti_Item = 0, Rtti_Sprite = 1, Rtti_PolygonalItem = 2,
  Rtti_Text = 3, Rtti_Polygon = 4, Rtti_Rectangle = 5, Rtti_Ellipse = 6,
  Rtti_Line = 7, Rtti_Spline = 8
}
 

Public Member Functions

virtual void advance (int stage)
 
virtual void advance (int stage)
 
int bottomEdge () const
 
int bottomEdge () const
 
int bottomEdge (int ny) const
 
int bottomEdge (int ny) const
 
QRect boundingRect () const
 
QRect boundingRect () const
 
bool collidesWith (const QtCanvasItem *) const
 
bool collidesWith (const QtCanvasItem *) const
 
void draw (QPainter &painter)
 
void draw (QPainter &painter)
 
int frame () const
 
int frame () const
 
int frameCount () const
 
int frameCount () const
 
int height () const
 
int height () const
 
QtCanvasPixmapimage () const
 
QtCanvasPixmapimage () const
 
QtCanvasPixmapimage (int f) const
 
QtCanvasPixmapimage (int f) const
 
virtual QtCanvasPixmapimageAdvanced () const
 
virtual QtCanvasPixmapimageAdvanced () const
 
int leftEdge () const
 
int leftEdge () const
 
int leftEdge (int nx) const
 
int leftEdge (int nx) const
 
void move (double x, double y)
 
void move (double x, double y)
 
virtual void move (double x, double y, int frame)
 
virtual void move (double x, double y, int frame)
 
 QtCanvasSprite (QtCanvasPixmapArray *array, QtCanvas *canvas)
 
 QtCanvasSprite (QtCanvasPixmapArray *array, QtCanvas *canvas)
 
int rightEdge () const
 
int rightEdge () const
 
int rightEdge (int nx) const
 
int rightEdge (int nx) const
 
int rtti () const
 
int rtti () const
 
void setFrame (int)
 
void setFrame (int)
 
virtual void setFrameAnimation (FrameAnimationType=Cycle, int step=1, int state=0)
 
virtual void setFrameAnimation (FrameAnimationType=Cycle, int step=1, int state=0)
 
void setSequence (QtCanvasPixmapArray *seq)
 
void setSequence (QtCanvasPixmapArray *seq)
 
int topEdge () const
 
int topEdge () const
 
int topEdge (int ny) const
 
int topEdge (int ny) const
 
int width () const
 
int width () const
 
virtual ~QtCanvasSprite ()
 
virtual ~QtCanvasSprite ()
 
- Public Member Functions inherited from QtCanvasItem
bool active () const
 
bool active () const
 
bool animated () const
 
bool animated () const
 
virtual QRect boundingRectAdvanced () const
 
virtual QRect boundingRectAdvanced () const
 
QtCanvascanvas () const
 
QtCanvascanvas () const
 
QtCanvasItemList collisions (bool exact) const
 
QtCanvasItemList collisions (bool exact) const
 
bool enabled () const
 
bool enabled () const
 
void hide ()
 
void hide ()
 
bool isActive () const
 
bool isActive () const
 
bool isEnabled () const
 
bool isEnabled () const
 
bool isSelected () const
 
bool isSelected () const
 
bool isVisible () const
 
bool isVisible () const
 
void move (double x, double y)
 
void move (double x, double y)
 
virtual void moveBy (double dx, double dy)
 
virtual void moveBy (double dx, double dy)
 
 QtCanvasItem (QtCanvas *canvas)
 
 QtCanvasItem (QtCanvas *canvas)
 
bool selected () const
 
bool selected () const
 
virtual void setActive (bool yes)
 
virtual void setActive (bool yes)
 
virtual void setAnimated (bool y)
 
virtual void setAnimated (bool y)
 
virtual void setCanvas (QtCanvas *)
 
virtual void setCanvas (QtCanvas *)
 
virtual void setEnabled (bool yes)
 
virtual void setEnabled (bool yes)
 
virtual void setSelected (bool yes)
 
virtual void setSelected (bool yes)
 
virtual void setVelocity (double vx, double vy)
 
virtual void setVelocity (double vx, double vy)
 
virtual void setVisible (bool yes)
 
virtual void setVisible (bool yes)
 
void setX (double a)
 
void setX (double a)
 
void setXVelocity (double vx)
 
void setXVelocity (double vx)
 
void setY (double a)
 
void setY (double a)
 
void setYVelocity (double vy)
 
void setYVelocity (double vy)
 
void setZ (double a)
 
void setZ (double a)
 
void show ()
 
void show ()
 
bool visible () const
 
bool visible () const
 
double x () const
 
double x () const
 
double xVelocity () const
 
double xVelocity () const
 
double y () const
 
double y () const
 
double yVelocity () const
 
double yVelocity () const
 
double z () const
 
double z () const
 
virtual ~QtCanvasItem ()
 
virtual ~QtCanvasItem ()
 

Static Public Attributes

static int RTTI = Rtti_Sprite
 
- Static Public Attributes inherited from QtCanvasItem
static int RTTI = Rtti_Item
 

Private Member Functions

void addToChunks ()
 
void addToChunks ()
 
void changeChunks ()
 
void changeChunks ()
 
bool collidesWith (const QtCanvasSprite *, const QtCanvasPolygonalItem *, const QtCanvasRectangle *, const QtCanvasEllipse *, const QtCanvasText *) const
 
bool collidesWith (const QtCanvasSprite *, const QtCanvasPolygonalItem *, const QtCanvasRectangle *, const QtCanvasEllipse *, const QtCanvasText *) const
 
void removeFromChunks ()
 
void removeFromChunks ()
 

Private Attributes

uint anim_state: 2
 
uint anim_type: 14
 
ushort anim_val
 
int frm
 
QtCanvasPixmapArrayimages
 

Friends

bool qt_testCollision (const QtCanvasSprite *s1, const QtCanvasSprite *s2)
 
bool qt_testCollision (const QtCanvasSprite *s1, const QtCanvasSprite *s2)
 

Additional Inherited Members

- Protected Member Functions inherited from QtCanvasItem
void update ()
 
void update ()
 

Member Enumeration Documentation

◆ FrameAnimationType [1/2]

Enumerator
Cycle 
Oscillate 
Cycle 
Oscillate 

◆ FrameAnimationType [2/2]

Enumerator
Cycle 
Oscillate 
Cycle 
Oscillate 

Constructor & Destructor Documentation

◆ QtCanvasSprite() [1/2]

QtCanvasSprite::QtCanvasSprite ( QtCanvasPixmapArray array,
QtCanvas canvas 
)

◆ ~QtCanvasSprite() [1/2]

QtCanvasSprite::~QtCanvasSprite ( )
virtual

References removeFromChunks().

+ Here is the call graph for this function:

◆ QtCanvasSprite() [2/2]

QtCanvasSprite::QtCanvasSprite ( QtCanvasPixmapArray array,
QtCanvas canvas 
)

◆ ~QtCanvasSprite() [2/2]

virtual QtCanvasSprite::~QtCanvasSprite ( )
virtual

Member Function Documentation

◆ addToChunks() [1/2]

void QtCanvasSprite::addToChunks ( )
privatevirtual

Reimplemented from QtCanvasItem.

References QtCanvas::addItemToChunk(), bottomEdge(), QtCanvasItem::canvas(), QtCanvas::chunkSize(), QtCanvasItem::isVisible(), leftEdge(), rightEdge(), and topEdge().

+ Here is the call graph for this function:

◆ addToChunks() [2/2]

void QtCanvasSprite::addToChunks ( )
privatevirtual

Reimplemented from QtCanvasItem.

◆ advance() [1/2]

void QtCanvasSprite::advance ( int  stage)
virtual

Reimplemented from QtCanvasItem.

References anim_state, anim_type, anim_val, frame(), frameCount(), move(), Oscillate, QtCanvasItem::x(), QtCanvasItem::xVelocity(), QtCanvasItem::y(), and QtCanvasItem::yVelocity().

+ Here is the call graph for this function:

◆ advance() [2/2]

virtual void QtCanvasSprite::advance ( int  stage)
virtual

Reimplemented from QtCanvasItem.

◆ bottomEdge() [1/4]

int QtCanvasSprite::bottomEdge ( ) const

◆ bottomEdge() [2/4]

int QtCanvasSprite::bottomEdge ( ) const

References image(), and topEdge().

Referenced by addToChunks(), changeChunks(), and removeFromChunks().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bottomEdge() [3/4]

int QtCanvasSprite::bottomEdge ( int  ny) const

References image(), and topEdge().

+ Here is the call graph for this function:

◆ bottomEdge() [4/4]

int QtCanvasSprite::bottomEdge ( int  ny) const

◆ boundingRect() [1/2]

QRect QtCanvasSprite::boundingRect ( ) const
virtual

Implements QtCanvasItem.

◆ boundingRect() [2/2]

QRect QtCanvasSprite::boundingRect ( ) const
virtual

Implements QtCanvasItem.

References height(), leftEdge(), topEdge(), and width().

+ Here is the call graph for this function:

◆ changeChunks() [1/2]

void QtCanvasSprite::changeChunks ( )
privatevirtual

Reimplemented from QtCanvasItem.

References bottomEdge(), QtCanvasItem::canvas(), QtCanvas::chunkSize(), QtCanvasItem::isVisible(), leftEdge(), rightEdge(), QtCanvas::setChangedChunk(), and topEdge().

+ Here is the call graph for this function:

◆ changeChunks() [2/2]

void QtCanvasSprite::changeChunks ( )
privatevirtual

Reimplemented from QtCanvasItem.

◆ collidesWith() [1/4]

bool QtCanvasSprite::collidesWith ( const QtCanvasItem i) const
virtual

Implements QtCanvasItem.

References QtCanvasItem::collidesWith().

+ Here is the call graph for this function:

◆ collidesWith() [2/4]

bool QtCanvasSprite::collidesWith ( const QtCanvasItem ) const
virtual

Implements QtCanvasItem.

◆ collidesWith() [3/4]

bool QtCanvasSprite::collidesWith ( const QtCanvasSprite s,
const QtCanvasPolygonalItem p,
const QtCanvasRectangle r,
const QtCanvasEllipse e,
const QtCanvasText t 
) const
privatevirtual

Implements QtCanvasItem.

References collision_double_dispatch().

+ Here is the call graph for this function:

◆ collidesWith() [4/4]

bool QtCanvasSprite::collidesWith ( const QtCanvasSprite ,
const QtCanvasPolygonalItem ,
const QtCanvasRectangle ,
const QtCanvasEllipse ,
const QtCanvasText  
) const
privatevirtual

Implements QtCanvasItem.

◆ draw() [1/2]

void QtCanvasSprite::draw ( QPainter &  painter)
virtual

Implements QtCanvasItem.

References image(), leftEdge(), and topEdge().

+ Here is the call graph for this function:

◆ draw() [2/2]

void QtCanvasSprite::draw ( QPainter &  painter)
virtual

Implements QtCanvasItem.

◆ frame() [1/2]

int QtCanvasSprite::frame ( ) const
inline

References frm.

◆ frame() [2/2]

int QtCanvasSprite::frame ( ) const
inline

References frm.

Referenced by advance().

+ Here is the caller graph for this function:

◆ frameCount() [1/2]

int QtCanvasSprite::frameCount ( ) const
inline

References QtCanvasPixmapArray::count(), and images.

+ Here is the call graph for this function:

◆ frameCount() [2/2]

int QtCanvasSprite::frameCount ( ) const
inline

References QtCanvasPixmapArray::count(), and images.

Referenced by advance(), and move().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ height() [1/2]

int QtCanvasSprite::height ( ) const

◆ height() [2/2]

int QtCanvasSprite::height ( ) const

References image().

Referenced by boundingRect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ image() [1/4]

QtCanvasPixmap* QtCanvasSprite::image ( ) const
inline

References frm, QtCanvasPixmapArray::image(), and images.

+ Here is the call graph for this function:

◆ image() [2/4]

QtCanvasPixmap* QtCanvasSprite::image ( ) const
inline

References frm, QtCanvasPixmapArray::image(), and images.

Referenced by bottomEdge(), draw(), height(), imageAdvanced(), leftEdge(), rightEdge(), topEdge(), and width().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ image() [3/4]

QtCanvasPixmap* QtCanvasSprite::image ( int  f) const
inline

References QtCanvasPixmapArray::image(), and images.

+ Here is the call graph for this function:

◆ image() [4/4]

QtCanvasPixmap* QtCanvasSprite::image ( int  f) const
inline

References QtCanvasPixmapArray::image(), and images.

+ Here is the call graph for this function:

◆ imageAdvanced() [1/2]

virtual QtCanvasPixmap* QtCanvasSprite::imageAdvanced ( ) const
virtual

◆ imageAdvanced() [2/2]

QtCanvasPixmap * QtCanvasSprite::imageAdvanced ( ) const
virtual

References image().

Referenced by qt_testCollision().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ leftEdge() [1/4]

int QtCanvasSprite::leftEdge ( ) const

◆ leftEdge() [2/4]

int QtCanvasSprite::leftEdge ( ) const

References QtCanvasPixmap::hotx, image(), and QtCanvasItem::x().

Referenced by addToChunks(), boundingRect(), changeChunks(), draw(), removeFromChunks(), and rightEdge().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ leftEdge() [3/4]

int QtCanvasSprite::leftEdge ( int  nx) const

References QtCanvasPixmap::hotx, and image().

+ Here is the call graph for this function:

◆ leftEdge() [4/4]

int QtCanvasSprite::leftEdge ( int  nx) const

◆ move() [1/4]

void QtCanvasSprite::move ( double  x,
double  y 
)

References QtCanvasItem::move(), QtCanvasItem::x(), and QtCanvasItem::y().

Referenced by advance(), and setFrame().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ move() [2/4]

void QtCanvasSprite::move ( double  x,
double  y 
)

◆ move() [3/4]

virtual void QtCanvasSprite::move ( double  x,
double  y,
int  frame 
)
virtual

◆ move() [4/4]

void QtCanvasSprite::move ( double  x,
double  y,
int  frame 
)
virtual

References QtCanvasItem::canvas(), frameCount(), frm, QtCanvasItem::hide(), QtCanvasItem::isVisible(), QtCanvasItem::move(), and QtCanvasItem::show().

+ Here is the call graph for this function:

◆ removeFromChunks() [1/2]

void QtCanvasSprite::removeFromChunks ( )
privatevirtual

Reimplemented from QtCanvasItem.

◆ removeFromChunks() [2/2]

void QtCanvasSprite::removeFromChunks ( )
privatevirtual

Reimplemented from QtCanvasItem.

References bottomEdge(), QtCanvasItem::canvas(), QtCanvas::chunkSize(), QtCanvasItem::isVisible(), leftEdge(), QtCanvas::removeItemFromChunk(), rightEdge(), and topEdge().

Referenced by ~QtCanvasSprite().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rightEdge() [1/4]

int QtCanvasSprite::rightEdge ( ) const

References image(), and leftEdge().

Referenced by addToChunks(), changeChunks(), and removeFromChunks().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rightEdge() [2/4]

int QtCanvasSprite::rightEdge ( ) const

◆ rightEdge() [3/4]

int QtCanvasSprite::rightEdge ( int  nx) const

References image(), and leftEdge().

+ Here is the call graph for this function:

◆ rightEdge() [4/4]

int QtCanvasSprite::rightEdge ( int  nx) const

◆ rtti() [1/2]

int QtCanvasSprite::rtti ( ) const
virtual

Reimplemented from QtCanvasItem.

◆ rtti() [2/2]

int QtCanvasSprite::rtti ( ) const
virtual

Reimplemented from QtCanvasItem.

References RTTI.

◆ setFrame() [1/2]

void QtCanvasSprite::setFrame ( int  f)

References move(), QtCanvasItem::x(), and QtCanvasItem::y().

+ Here is the call graph for this function:

◆ setFrame() [2/2]

void QtCanvasSprite::setFrame ( int  )

◆ setFrameAnimation() [1/2]

virtual void QtCanvasSprite::setFrameAnimation ( FrameAnimationType  = Cycle,
int  step = 1,
int  state = 0 
)
virtual

◆ setFrameAnimation() [2/2]

void QtCanvasSprite::setFrameAnimation ( FrameAnimationType  type = Cycle,
int  step = 1,
int  state = 0 
)
virtual

References anim_state, anim_type, anim_val, and QtCanvasItem::setAnimated().

+ Here is the call graph for this function:

◆ setSequence() [1/2]

void QtCanvasSprite::setSequence ( QtCanvasPixmapArray seq)

◆ setSequence() [2/2]

void QtCanvasSprite::setSequence ( QtCanvasPixmapArray seq)

References a, QtCanvasPixmapArray::count(), frm, QtCanvasItem::hide(), images, QtCanvasItem::isVisible(), and QtCanvasItem::show().

+ Here is the call graph for this function:

◆ topEdge() [1/4]

int QtCanvasSprite::topEdge ( ) const

References QtCanvasPixmap::hoty, image(), and QtCanvasItem::y().

Referenced by addToChunks(), bottomEdge(), boundingRect(), changeChunks(), draw(), and removeFromChunks().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ topEdge() [2/4]

int QtCanvasSprite::topEdge ( ) const

◆ topEdge() [3/4]

int QtCanvasSprite::topEdge ( int  ny) const

References QtCanvasPixmap::hoty, and image().

+ Here is the call graph for this function:

◆ topEdge() [4/4]

int QtCanvasSprite::topEdge ( int  ny) const

◆ width() [1/2]

int QtCanvasSprite::width ( ) const

◆ width() [2/2]

int QtCanvasSprite::width ( ) const

References image().

Referenced by boundingRect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ qt_testCollision [1/2]

bool qt_testCollision ( const QtCanvasSprite s1,
const QtCanvasSprite s2 
)
friend

◆ qt_testCollision [2/2]

bool qt_testCollision ( const QtCanvasSprite s1,
const QtCanvasSprite s2 
)
friend

Member Data Documentation

◆ anim_state

uint QtCanvasSprite::anim_state
private

Referenced by advance(), and setFrameAnimation().

◆ anim_type

uint QtCanvasSprite::anim_type
private

Referenced by advance(), and setFrameAnimation().

◆ anim_val

ushort QtCanvasSprite::anim_val
private

Referenced by advance(), and setFrameAnimation().

◆ frm

int QtCanvasSprite::frm
private

Referenced by frame(), image(), move(), and setSequence().

◆ images

QtCanvasPixmapArray * QtCanvasSprite::images
private

Referenced by frameCount(), image(), and setSequence().

◆ RTTI

static int QtCanvasSprite::RTTI = Rtti_Sprite
static

Referenced by rtti().


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