animpoint.cpp
changeset 461 b0d72eb511c9
child 688 d0086df58648
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/animpoint.cpp	Wed Apr 25 16:02:54 2007 +0000
     1.3 @@ -0,0 +1,70 @@
     1.4 +#include "animpoint.h"
     1.5 +
     1.6 +AnimPoint::AnimPoint()
     1.7 +{
     1.8 +	init();
     1.9 +}
    1.10 +
    1.11 +void AnimPoint::operator= ( const AnimPoint & other )
    1.12 +{
    1.13 +	copy (other);
    1.14 +}
    1.15 +
    1.16 +void AnimPoint::operator= ( const QPointF & other )
    1.17 +{
    1.18 +	init();
    1.19 +	setX (other.x() );
    1.20 +	setY (other.x() );
    1.21 +}
    1.22 +
    1.23 +bool AnimPoint::operator== ( const QPointF& other )
    1.24 +{
    1.25 +	QPointF p( x(),y());
    1.26 +	return p == other;
    1.27 +}
    1.28 +
    1.29 +bool AnimPoint::operator== ( AnimPoint  other )
    1.30 +{
    1.31 +    if (rx() != other.rx() ) return false;
    1.32 +    if (ry() != other.ry() ) return false;
    1.33 +    if (animated != other.animated ) return false;
    1.34 +
    1.35 +	return true;
    1.36 +}
    1.37 +
    1.38 +void AnimPoint::init ()
    1.39 +{
    1.40 +	animated=false;
    1.41 +}
    1.42 +
    1.43 +void AnimPoint::copy (AnimPoint other)
    1.44 +{
    1.45 +	setX (other.x() );
    1.46 +	setY (other.x() );
    1.47 +	animated=other.animated;
    1.48 +}
    1.49 +
    1.50 +
    1.51 +void AnimPoint::setDest(const QPointF &p)
    1.52 +{
    1.53 +	destPos=p;
    1.54 +}
    1.55 +
    1.56 +void AnimPoint::setAnimated(bool b)
    1.57 +{
    1.58 +	animated=b;
    1.59 +}
    1.60 +
    1.61 +bool AnimPoint::isAnimated()
    1.62 +{
    1.63 +	return animated;
    1.64 +}
    1.65 +
    1.66 +void AnimPoint::animate()
    1.67 +{
    1.68 +	setX (x()+1);
    1.69 +	setY (y()+1);
    1.70 +}
    1.71 +
    1.72 +
    1.73 +