новые иконки в OpenBoard
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
OpenBoard/src/domain/UBGraphicsStroke.cpp

73 lines
1.1 KiB

/*
* UBGraphicsStroke.cpp
*
* Created on: 28 sept. 2009
* Author: Luc
*/
#include "UBGraphicsStroke.h"
#include "UBGraphicsPolygonItem.h"
UBGraphicsStroke::UBGraphicsStroke()
{
// NOOP
}
UBGraphicsStroke::~UBGraphicsStroke()
{
// NOOP
}
void UBGraphicsStroke::addPolygon(UBGraphicsPolygonItem* pol)
{
mPolygons << pol;
}
QList<UBGraphicsPolygonItem*> UBGraphicsStroke::polygons() const
{
return mPolygons;
}
bool UBGraphicsStroke::hasPressure()
{
if (mPolygons.count() > 2)
{
qreal nominalWidth = mPolygons.at(0)->originalWidth();
foreach(UBGraphicsPolygonItem* pol, mPolygons)
{
if (!pol->isNominalLine() || pol->originalWidth() != nominalWidth)
return true;
}
}
return false;
}
UBGraphicsStroke* UBGraphicsStroke::deepCopy()
{
UBGraphicsStroke* clone = new UBGraphicsStroke();
return clone;
}
bool UBGraphicsStroke::hasAlpha() const
{
if (mPolygons.length() > 0 && mPolygons.at(0)->color().alphaF() != 1.0)
{
return true;
}
else
{
return false;
}
}