mirror of
https://github.com/mapmapteam/mapmap.git
synced 2026-06-16 12:33:19 +02:00
First step in refactoring: brought both Paint and Mapping under the common umbrella class Element and implemented basic QProperties.
This commit is contained in:
+5
-15
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user