void remove(Entity* entity, ComponentType componentType) { auto operation = createOperation(); operation->type = OperationType::Remove; operation->entity = entity; operation->componentType = componentType; schedule(operation); }
void add(Entity* entity) { auto operation = createOperation(); operation->type = OperationType::Add; operation->entity = entity; schedule(operation); }
Ref<TransformOperation> Matrix3DTransformOperation::blend(const TransformOperation* from, double progress, bool blendToIdentity) { if (from && !from->isSameType(*this)) return *this; // Convert the TransformOperations into matrices FloatSize size; TransformationMatrix fromT; TransformationMatrix toT; if (from) from->apply(fromT, size); apply(toT, size); if (blendToIdentity) return createOperation(fromT, toT, progress); return createOperation(toT, fromT, progress); }
void add(Entity* entity, ComponentBase* component) { auto operation = createOperation(); operation->type = OperationType::Add; operation->entity = entity; operation->component = component; operation->componentType = 0; schedule(operation); }
/** * Slot for the context menu by right clicking in the tree widget. * @param p point of the right click inside the tree widget */ void RefactoringAssistant::showContextMenu(const QPoint& p) { QTreeWidgetItem* item = itemAt(p); if (!item) { return; } m_menu->clear(); UMLObject *obj = findUMLObject(item); if (obj) { // Menu for UMLObjects UMLObject::ObjectType t = obj->baseType(); if (t == UMLObject::ot_Class) { m_menu->addAction(createAction(i18n("Add Base Class"), SLOT(addBaseClassifier()), Icon_Utils::it_Generalisation)); m_menu->addAction(createAction(i18n("Add Derived Class"), SLOT(addDerivedClassifier()), Icon_Utils::it_Uniassociation)); // m_menu->addAction(createAction(i18n("Add Interface Implementation"), SLOT(addInterfaceImplementation()), Icon_Utils::it_Implementation)); m_menu->addAction(createAction(i18n("Add Operation"), SLOT(createOperation()), Icon_Utils::it_Public_Method)); m_menu->addAction(createAction(i18n("Add Attribute"), SLOT(createAttribute()), Icon_Utils::it_Public_Attribute)); } else if (t == UMLObject::ot_Interface) { m_menu->addAction(createAction(i18n("Add Base Interface"), SLOT(addSuperClassifier()), Icon_Utils::it_Generalisation)); m_menu->addAction(createAction(i18n("Add Derived Interface"), SLOT(addDerivedClassifier()), Icon_Utils::it_Uniassociation)); m_menu->addAction(createAction(i18n("Add Operation"), SLOT(createOperation()), Icon_Utils::it_Public_Method)); } // else { // DEBUG(DBG_SRC) << "No context menu for objects of type " << typeid(*obj).name(); // return; // } m_menu->addSeparator(); m_menu->addAction(createAction(i18n("Properties"), SLOT(editProperties()), Icon_Utils::it_Properties)); m_menu->addAction(createAction(i18n("Delete"), SLOT(deleteItem()), Icon_Utils::it_Delete)); } else { //menu for other ViewItems if (item->text(1) == QLatin1String("operations")) { m_menu->addAction(createAction(i18n("Add Operation"), SLOT(createOperation()), Icon_Utils::it_Public_Method)); } else if (item->text(1) == QLatin1String("attributes")) { m_menu->addAction(createAction(i18n("Add Attribute"), SLOT(createAttribute()), Icon_Utils::it_Public_Attribute)); } else { uWarning() << "Called for unsupported item."; return; } } m_menu->exec(mapToGlobal(p) + QPoint(0, 20)); }
void removeAll(Entity* entity) { auto operation = createOperation(); operation->type = OperationType::RemoveAll; operation->entity = entity; schedule(operation); }
void removeAll() { auto operation = createOperation(); operation->type = OperationType::RemoveAll; schedule(operation); }