Adjusted UI layout && Tested dynamic window expansion effects && Added node editor area (experimental, currently only one simple test node available with no practical functionality)
This commit is contained in:
@@ -12,6 +12,7 @@ extern "C"
|
||||
}
|
||||
|
||||
#include "Type_Descriptions.hpp"
|
||||
#include "Workflow-Editor.hpp"
|
||||
|
||||
// 主窗体句柄
|
||||
extern HWND Main_Window_hWnd;
|
||||
@@ -29,4 +30,7 @@ extern ID3D11RenderTargetView *g_mainRenderTargetView; // D3D11 渲染目标
|
||||
extern Input_File_Node *input_dlt_file_list_head;
|
||||
extern size_t input_dlt_file_count;
|
||||
|
||||
// 节点编辑器
|
||||
extern Workflow_Editor_Class Workflow_Editor;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,89 @@
|
||||
#ifndef __WORKFLOW_NODES_HPP__
|
||||
#define __WORKFLOW_NODES_HPP__
|
||||
|
||||
#include "imgui.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "stdint.h"
|
||||
}
|
||||
|
||||
#include <vector>
|
||||
|
||||
// // 并行工作链
|
||||
// class Parallel_Working_List
|
||||
// {
|
||||
// private:
|
||||
// // 节点计数
|
||||
// size_t node_count;
|
||||
|
||||
// // 内部迭代器
|
||||
// class iterator
|
||||
// {
|
||||
// };
|
||||
|
||||
// public:
|
||||
// iterator begin() { return iterator(arr); }
|
||||
// iterator end() { return iterator(arr + SIZE); }
|
||||
// };
|
||||
|
||||
// 节点类型枚举
|
||||
typedef enum
|
||||
{
|
||||
NODE_TYPE_MSG_LINE_INPUT, // 消息输入节点
|
||||
NODE_TYPE_CSV_EXPORTER, // CSV输出节点
|
||||
} NodeType;
|
||||
|
||||
// 节点基类
|
||||
class Node_Class
|
||||
{
|
||||
protected:
|
||||
int id; // 节点ID
|
||||
bool initial_state; // 初始状态
|
||||
ImVec2 initial_position; // 初始位置
|
||||
|
||||
public:
|
||||
// 初始化列表构造
|
||||
explicit Node_Class(int id, ImVec2 initial_position = ImVec2(0, 0)) : id(id), initial_state(true), initial_position(initial_position) {}
|
||||
int getID() { return this->id; }
|
||||
|
||||
/**
|
||||
* 显示节点并获取状态(子类必须实现)
|
||||
* @param null
|
||||
* @return 0 -> normal : 1-> close
|
||||
*/
|
||||
virtual bool show_and_get_state(void) = 0;
|
||||
|
||||
virtual ~Node_Class() = default; // 抽象基类必须有虚析构函数
|
||||
};
|
||||
|
||||
// 消息输出节点
|
||||
class MsgLine_Input_Node_Class : public Node_Class
|
||||
{
|
||||
public:
|
||||
explicit MsgLine_Input_Node_Class(int id, ImVec2 initial_position = ImVec2(0, 0)) : Node_Class(id, initial_position) {};
|
||||
bool show_and_get_state(void) override;
|
||||
};
|
||||
|
||||
// 节点编辑器类
|
||||
class Workflow_Editor_Class
|
||||
{
|
||||
protected:
|
||||
// 节点列表
|
||||
std::vector<Node_Class *> Node_List;
|
||||
|
||||
public:
|
||||
// 构造函数
|
||||
Workflow_Editor_Class();
|
||||
|
||||
// 析构函数
|
||||
~Workflow_Editor_Class();
|
||||
|
||||
// 显示工作流节点编辑器
|
||||
void Show(void);
|
||||
|
||||
// 新增节点
|
||||
void Add_Node(NodeType type, ImVec2 initial_position = ImVec2(0, 0));
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user