コード例 #1
0
ファイル: EntityOperations.hpp プロジェクト: Lusito/ECS-tasy
		void remove(Entity* entity, ComponentType componentType) {
			auto operation = createOperation();
			operation->type = OperationType::Remove;
			operation->entity = entity;
			operation->componentType = componentType;
			schedule(operation);
		}
コード例 #2
0
ファイル: EntityOperations.hpp プロジェクト: Lusito/ECS-tasy
		void add(Entity* entity) {
			auto operation = createOperation();
			operation->type = OperationType::Add;
			operation->entity = entity;

			schedule(operation);
		}
コード例 #3
0
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);
}
コード例 #4
0
ファイル: EntityOperations.hpp プロジェクト: Lusito/ECS-tasy
		void add(Entity* entity, ComponentBase* component) {
			auto operation = createOperation();
			operation->type = OperationType::Add;
			operation->entity = entity;
			operation->component = component;
			operation->componentType = 0;

			schedule(operation);
		}
コード例 #5
0
/**
 * 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));
}
コード例 #6
0
ファイル: EntityOperations.hpp プロジェクト: Lusito/ECS-tasy
		void removeAll(Entity* entity) {
			auto operation = createOperation();
			operation->type = OperationType::RemoveAll;
			operation->entity = entity;
			schedule(operation);
		}
コード例 #7
0
ファイル: EntityOperations.hpp プロジェクト: Lusito/ECS-tasy
		void removeAll() {
			auto operation = createOperation();
			operation->type = OperationType::RemoveAll;
			schedule(operation);
		}