void DUpdateVisitor::visitMObject(const MObject *object) { auto dobject = dynamic_cast<DObject *>(m_target); QMT_CHECK(dobject); if (isUpdating(object->stereotypes() != dobject->stereotypes())) dobject->setStereotypes(object->stereotypes()); const MObject *objectOwner = object->owner(); const MObject *diagramOwner = m_diagram->owner(); if (objectOwner && diagramOwner && objectOwner->uid() != diagramOwner->uid()) { if (isUpdating(objectOwner->name() != dobject->context())) dobject->setContext(objectOwner->name()); } else { if (isUpdating(!dobject->context().isEmpty())) dobject->setContext(QString()); } if (isUpdating(object->name() != dobject->name())) dobject->setName(object->name()); // TODO unlikely that this is called for all objects if hierarchy is modified // PERFORM remove loop int depth = 1; const MObject *owner = object->owner(); while (owner) { owner = owner->owner(); depth += 1; } if (isUpdating(depth != dobject->depth())) dobject->setDepth(depth); visitMElement(object); }
void DFlatAssignmentVisitor::visitDRelation(const DRelation *relation) { visitDElement(relation); auto target = dynamic_cast<DRelation *>(m_target); QMT_CHECK(target); target->setStereotypes(relation->stereotypes()); target->setIntermediatePoints(relation->intermediatePoints()); }
void DUpdateVisitor::visitMRelation(const MRelation *relation) { auto drelation = dynamic_cast<DRelation *>(m_target); QMT_CHECK(drelation); if (isUpdating(relation->stereotypes() != drelation->stereotypes())) drelation->setStereotypes(relation->stereotypes()); if (isUpdating(relation->name() != drelation->name())) drelation->setName(relation->name()); visitMElement(relation); }
void DFlatAssignmentVisitor::visitDObject(const DObject *object) { visitDElement(object); auto target = dynamic_cast<DObject *>(m_target); QMT_CHECK(target); target->setStereotypes(object->stereotypes()); target->setName(object->name()); target->setPos(object->pos()); target->setRect(object->rect()); target->setAutoSized(object->isAutoSized()); target->setDepth(object->depth()); target->setVisualPrimaryRole(object->visualPrimaryRole()); target->setVisualSecondaryRole(object->visualSecondaryRole()); target->setVisualEmphasized(object->isVisualEmphasized()); target->setStereotypeDisplay(object->stereotypeDisplay()); }