First step in refactoring: brought both Paint and Mapping under the common umbrella class Element and implemented basic QProperties.

This commit is contained in:
Tats
2016-01-04 00:19:34 -06:00
parent 1b7df1ce3d
commit 99b19dfcc6
9 changed files with 177 additions and 72 deletions
+5 -15
View File
@@ -23,25 +23,15 @@
UidAllocator Mapping::allocator;
Mapping::Mapping(Paint::ptr paint, MShape::ptr shape, uid id)
: _paint(paint), _shape(shape),
_isLocked(false), _isSolo(false), _isVisible(true), _opacity(1.0f)
: Element(id, &allocator),
_paint(paint), _shape(shape),
_isSolo(false), _isVisible(true)
{
if (id == NULL_UID)
id = allocator.allocate();
else
{
Q_ASSERT(!allocator.exists(id));
allocator.reserve(id);
}
// Assign id.
_id = id;
// Default.
_depth = _id;
_depth = getId();
}
Mapping::~Mapping() {
allocator.free(_id);
allocator.free(getId());
}