Keep part attributes while been splitted
parent
c9efa79ddb
commit
5ac8968cee
|
@ -54,6 +54,7 @@ void SkeletonDocument::removeEdge(QUuid edgeId)
|
||||||
splitPartByEdge(&groups, edgeId);
|
splitPartByEdge(&groups, edgeId);
|
||||||
for (auto groupIt = groups.begin(); groupIt != groups.end(); groupIt++) {
|
for (auto groupIt = groups.begin(); groupIt != groups.end(); groupIt++) {
|
||||||
SkeletonPart part;
|
SkeletonPart part;
|
||||||
|
part.copyAttributes(*oldPart);
|
||||||
part.name = nextPartName;
|
part.name = nextPartName;
|
||||||
for (auto nodeIdIt = (*groupIt).begin(); nodeIdIt != (*groupIt).end(); nodeIdIt++) {
|
for (auto nodeIdIt = (*groupIt).begin(); nodeIdIt != (*groupIt).end(); nodeIdIt++) {
|
||||||
auto nodeIt = nodeMap.find(*nodeIdIt);
|
auto nodeIt = nodeMap.find(*nodeIdIt);
|
||||||
|
@ -115,6 +116,7 @@ void SkeletonDocument::removeNode(QUuid nodeId)
|
||||||
splitPartByNode(&groups, nodeId);
|
splitPartByNode(&groups, nodeId);
|
||||||
for (auto groupIt = groups.begin(); groupIt != groups.end(); groupIt++) {
|
for (auto groupIt = groups.begin(); groupIt != groups.end(); groupIt++) {
|
||||||
SkeletonPart part;
|
SkeletonPart part;
|
||||||
|
part.copyAttributes(*oldPart);
|
||||||
part.name = nextPartName;
|
part.name = nextPartName;
|
||||||
for (auto nodeIdIt = (*groupIt).begin(); nodeIdIt != (*groupIt).end(); nodeIdIt++) {
|
for (auto nodeIdIt = (*groupIt).begin(); nodeIdIt != (*groupIt).end(); nodeIdIt++) {
|
||||||
auto nodeIt = nodeMap.find(*nodeIdIt);
|
auto nodeIt = nodeMap.find(*nodeIdIt);
|
||||||
|
|
|
@ -78,6 +78,13 @@ public:
|
||||||
{
|
{
|
||||||
id = withId.isNull() ? QUuid::createUuid() : withId;
|
id = withId.isNull() ? QUuid::createUuid() : withId;
|
||||||
}
|
}
|
||||||
|
void copyAttributes(const SkeletonPart &other)
|
||||||
|
{
|
||||||
|
visible = other.visible;
|
||||||
|
locked = other.locked;
|
||||||
|
subdived = other.subdived;
|
||||||
|
disabled = other.disabled;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class SkeletonProfile
|
enum class SkeletonProfile
|
||||||
|
|
Loading…
Reference in New Issue