Computer Assisted Medical Intervention Tool Kit  version 5.2
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
 

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

◆ QtCanvasSprite() [2/2]

QtCanvasSprite::QtCanvasSprite ( QtCanvasPixmapArray array,
QtCanvas canvas 
)

◆ ~QtCanvasSprite() [2/2]

virtual QtCanvasSprite::~QtCanvasSprite ( )
virtual

Member Function Documentation

◆ advance() [1/2]

void QtCanvasSprite::advance ( int  stage)
virtual

Reimplemented from QtCanvasItem.

References 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

References image(), and topEdge().

+ Here is the call graph for this function:

◆ bottomEdge() [2/4]

int QtCanvasSprite::bottomEdge ( ) const

◆ 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.

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

+ Here is the call graph for this function:

◆ boundingRect() [2/2]

QRect QtCanvasSprite::boundingRect ( ) const
virtual

Implements QtCanvasItem.

◆ collidesWith() [1/2]

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

Implements QtCanvasItem.

References QtCanvasItem::collidesWith().

+ Here is the call graph for this function:

◆ collidesWith() [2/2]

bool QtCanvasSprite::collidesWith ( const QtCanvasItem ) const
virtual

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

Referenced by advance().

+ Here is the caller graph for this function:

◆ frame() [2/2]

int QtCanvasSprite::frame ( ) const
inline

◆ frameCount() [1/2]

int QtCanvasSprite::frameCount ( ) const
inline

References QtCanvasPixmapArray::count().

Referenced by advance(), and move().

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

◆ frameCount() [2/2]

int QtCanvasSprite::frameCount ( ) const
inline

References QtCanvasPixmapArray::count().

+ Here is the call graph for this function:

◆ height() [1/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:

◆ height() [2/2]

int QtCanvasSprite::height ( ) const

◆ image() [1/4]

QtCanvasPixmap* QtCanvasSprite::image ( ) const
inline

References QtCanvasPixmapArray::image().

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() [2/4]

QtCanvasPixmap* QtCanvasSprite::image ( ) const
inline

References QtCanvasPixmapArray::image().

+ Here is the call graph for this function:

◆ image() [3/4]

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

References QtCanvasPixmapArray::image().

+ Here is the call graph for this function:

◆ image() [4/4]

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

References QtCanvasPixmapArray::image().

+ Here is the call graph for this function:

◆ imageAdvanced() [1/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:

◆ imageAdvanced() [2/2]

virtual QtCanvasPixmap* QtCanvasSprite::imageAdvanced ( ) const
virtual

◆ leftEdge() [1/4]

int QtCanvasSprite::leftEdge ( ) const

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

Referenced by boundingRect(), draw(), and rightEdge().

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

◆ leftEdge() [2/4]

int QtCanvasSprite::leftEdge ( ) const

◆ leftEdge() [3/4]

int QtCanvasSprite::leftEdge ( int  nx) const

References 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]

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

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

+ Here is the call graph for this function:

◆ move() [4/4]

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

◆ rightEdge() [1/4]

int QtCanvasSprite::rightEdge ( ) const

References image(), and leftEdge().

+ Here is the call 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.

References RTTI.

◆ rtti() [2/2]

int QtCanvasSprite::rtti ( ) const
virtual

Reimplemented from QtCanvasItem.

◆ 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]

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

References QtCanvasItem::setAnimated().

+ Here is the call graph for this function:

◆ setFrameAnimation() [2/2]

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

◆ setSequence() [1/2]

void QtCanvasSprite::setSequence ( QtCanvasPixmapArray seq)

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

+ Here is the call graph for this function:

◆ setSequence() [2/2]

void QtCanvasSprite::setSequence ( QtCanvasPixmapArray seq)

◆ topEdge() [1/4]

int QtCanvasSprite::topEdge ( ) const

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

Referenced by bottomEdge(), boundingRect(), and draw().

+ 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 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

References image().

Referenced by boundingRect().

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

◆ width() [2/2]

int QtCanvasSprite::width ( ) const

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

◆ RTTI

static int QtCanvasSprite::RTTI = Rtti_Sprite
static

Referenced by rtti().


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