-
Notifications
You must be signed in to change notification settings - Fork 176
Expand file tree
/
Copy pathAnnotationBase.cpp
More file actions
51 lines (43 loc) · 1.08 KB
/
AnnotationBase.cpp
File metadata and controls
51 lines (43 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "AnnotationBase.h"
#include "AnnotationGroup.h"
#include "psimpl.h"
#include <limits>
AnnotationBase::AnnotationBase() :
_name(""),
_color("#F4FA58"),
_modified(true)
{
}
AnnotationBase::~AnnotationBase() {
}
std::string AnnotationBase::getColor() const {
return _color;
}
void AnnotationBase::setColor(const std::string& color) {
_color = color;
}
void AnnotationBase::setName(const std::string& name)
{
_name = name;
}
std::string AnnotationBase::getName() const
{
return _name;
};
void AnnotationBase::setGroup(const std::shared_ptr<AnnotationGroup>& group) {
std::shared_ptr<AnnotationGroup> currentGroup = _group.lock();
if (!currentGroup || currentGroup != group) {
_group.reset();
if (currentGroup) {
currentGroup->removeMember(this->shared_from_this());
}
_group = group;
if (group) {
group->addMember(this->shared_from_this());
}
}
}
std::shared_ptr<AnnotationGroup> AnnotationBase::getGroup() const {
std::shared_ptr<AnnotationGroup> grp = _group.lock();
return grp;
}