/* *@file DeleteModuleCmd.h *@brief 删除工作流中的模块 *@date: 2012-10-9 *@author: liujunxia */ #ifndef PAI_FRAME_WORKFLOWVIEW_DELETEMODULECMD_H_ #define PAI_FRAME_WORKFLOWVIEW_DELETEMODULECMD_H_ #include #include #include "ModuleInformation.h" #include "ModuleConnection.h" namespace pai { namespace objectmodel { class PaiWorkflowDataModel; } namespace graphics2d { class WorkflowSceneManager; class CModuleInfoAndStyle; } /** * @class DeleteModuleCmd * @brief 拷贝工作流中的模块 */ class DeleteModuleCmd :public QUndoCommand { public: DeleteModuleCmd(pai::graphics2d::WorkflowSceneManager *pSceneManager, pai::objectmodel::PaiWorkflowDataModel *pWorkflow, QList list, QUndoCommand *parent = 0); virtual ~DeleteModuleCmd(); /** * @brief undo 操作 */ void undo(); /** * @brief redo 操作 */ void redo(); private: /** * @brief 删除选中的工作流模块 */ void deleteModule(); /** * @brief 删除选中的工作流连线 */ void deleteConnection(); /** *@brief 添加模块后更新连线的source 和 destination id. *@param startId 需要更新的 source 和 destination id 的最小值. */ void updateConnectionLines(int startId); /** *@brief 添加模块后更新模块的Step id。 *@param startId 需要更新的 Step id 的最小值. */ void updateModuleInfos(int startId); /** * @brief 获得删除模块的所有连线。 * @param 要删除的模块列表. */ QList GetDeletedModuleConnections(QList selectedItems); private: QList m_stepIdList; QList m_connectionList; pai::graphics2d::WorkflowSceneManager *m_pSceneManager; pai::objectmodel::PaiWorkflowDataModel* m_pWorkflow; QList m_deletedModules; }; } #endif /* DELETEMODULECMD_H_ */