finalcut/src/fpoint.cpp

63 lines
1.4 KiB
C++
Raw Normal View History

// File: fpoint.cpp
// Provides: class FPoint
2015-05-23 13:35:12 +02:00
#include "final/fpoint.h"
2015-05-23 13:35:12 +02:00
//----------------------------------------------------------------------
// class FPoint
//----------------------------------------------------------------------
FPoint::~FPoint() // destructor
2015-09-22 04:18:20 +02:00
{ }
2015-05-23 13:35:12 +02:00
// public methods of FPoint
//----------------------------------------------------------------------
FPoint& FPoint::operator = (const FPoint& p)
2015-05-23 13:35:12 +02:00
{
xpos = p.xpos;
ypos = p.ypos;
return *this;
2015-05-23 13:35:12 +02:00
}
//----------------------------------------------------------------------
FPoint& FPoint::operator += (const FPoint& p)
2015-05-23 13:35:12 +02:00
{
xpos = short(xpos + p.xpos);
ypos = short(ypos + p.ypos);
return *this;
2015-05-23 13:35:12 +02:00
}
//----------------------------------------------------------------------
FPoint& FPoint::operator -= (const FPoint& p)
2015-05-23 13:35:12 +02:00
{
xpos = short(xpos - p.xpos);
ypos = short(ypos - p.ypos);
return *this;
2015-05-23 13:35:12 +02:00
}
//----------------------------------------------------------------------
void FPoint::setX (int x)
2015-05-23 13:35:12 +02:00
{
xpos = short(x);
}
//----------------------------------------------------------------------
void FPoint::setY (int y)
2015-05-23 13:35:12 +02:00
{
ypos = short(y);
2015-05-23 13:35:12 +02:00
}
//----------------------------------------------------------------------
void FPoint::setPoint (int x, int y)
2015-05-23 13:35:12 +02:00
{
xpos = short(x);
ypos = short(y);
2015-05-23 13:35:12 +02:00
}
//----------------------------------------------------------------------
bool FPoint::isNull() const
2015-05-23 13:35:12 +02:00
{
return xpos == 0 && ypos == 0;
2015-05-23 13:35:12 +02:00
}