bool FixtureGroup::assignFixture(quint32 id, const QLCPoint& pt) { Fixture* fxi = doc()->fixture(id); Q_ASSERT(fxi != NULL); QLCPoint tmp = pt; int headAddedcount = 0; for (int i = 0; i < fxi->heads(); i++) { if (pt.isNull()) { if (assignHead(pt, GroupHead(fxi->id(), i)) == true) headAddedcount++; } else { if (assignHead(tmp, GroupHead(fxi->id(), i)) == true) headAddedcount++; tmp.setX(tmp.x() + 1); if (tmp.x() >= size().width()) { tmp.setX(0); tmp.setY(tmp.y() + 1); } } } return headAddedcount ? true : false; }
uint qHash(const QLCPoint& key) { uint hash; hash = key.x() << 16; hash = hash | (key.y() & 0xFFFF); hash = hash & (~0U); return hash; }
void FixtureGroup::assignFixture(quint32 id, const QLCPoint& pt) { Fixture* fxi = doc()->fixture(id); Q_ASSERT(fxi != NULL); QLCPoint tmp = pt; for (int i = 0; i < fxi->heads(); i++) { if (pt.isNull()) { assignHead(pt, GroupHead(fxi->id(), i)); } else { assignHead(tmp, GroupHead(fxi->id(), i)); tmp.setX(tmp.x() + 1); if (tmp.x() >= size().width()) { tmp.setX(0); tmp.setY(tmp.y() + 1); } } } }