Commit 30c2f3c9 authored by Blackbeard (alberto flores)'s avatar Blackbeard (alberto flores) 🚢

Populate brushesPipe with VectorShapeObjects

parent d1afdb40
......@@ -37,37 +37,49 @@
// helper Class to hold all the KisVectorShape Objects
class KisVectorHelperPipe : public KisBrushesPipe<KisVectorShapeObject>
{
public:
KisVectorHelperPipe()
: m_currentIndex(0)
{
m_parasite.setIndex(0);
}
public:
int currentBrushIndex() override {
int currentBrushIndex() override
{
return m_currentIndex;
}
int chooseNextBrush(const KisPaintInformation& info) override {
int chooseNextBrush(const KisPaintInformation& info) override
{
Q_UNUSED(info)
m_currentIndex = m_parasite.index();
qDebug() << "dab" << m_currentIndex;
m_parasite.nextIndex();
return m_currentIndex;
}
void updateBrushIndexes(const KisPaintInformation& info, int seqNo) override {
Q_UNUSED(info)
Q_UNUSED(seqNo)
// m_parasite.nextIndex();
// m_currentIndex = m_parasite.index();
// qDebug() << "dab" << m_currentIndex;
}
void updateBrushIndexes(const KisPaintInformation& info, int seqNo) override
{
Q_UNUSED(info)
Q_UNUSED(seqNo)
// m_parasite.nextIndex();
// m_currentIndex = m_parasite.index();
// qDebug() << "dab" << m_currentIndex;
}
void notifyStrokeStarted() override {
qDebug() << "stroke";
}
void setParasite(const KisVectorBrushParasite& parasite) {
m_parasite = parasite;
}
void addShapeBrush(KisVectorShapeObject* brush)
{
addBrush(brush);
}
private:
int m_currentIndex;
......@@ -143,20 +155,26 @@ bool KisVectorAnimatedBrush::loadFromDevice(QIODevice *dev)
m_d->brushesPipe.setParasite(m_parasite);
// clean de brush
m_vectorObjects.clear();
// m_vectorObjects.clear();
// convert the shapes to KisVectorShapeObjects
for(int i = 0; i<m_shapes.count(); i++)
{
m_vectorObjects.append(KisVectorShapeObject(m_shapes.at(i)));
for (int i = 0; i<m_shapes.count(); i++) {
m_d->brushesPipe.addShapeBrush(new KisVectorShapeObject(m_shapes.at(i)));
}
KisVectorShapeObject currentVectorObject = m_vectorObjects.at(m_parasite.index());
// KisVectorShapeObject currentVectorObject = m_vectorObjects.at(m_parasite.index());
QImage tip = currentVectorObject.image();
// QImage tip = currentVectorObject.image();
setBrushTipImage(tip);
// for(int i = 0; i<m_shapes.count(); i++)
// {
// KisVectorShapeObject* brush = new KisVectorShapeObject(name() + '_' + QString().setNum(i),
// m_vectorObjects.at(m_parasite.)
// }
// // setBrushTipImage(tip);
setBrushTipImage(m_d->brushesPipe.firstBrush()->brushTipImage());
setValid(true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment