Modified the way connectors associate with storage.Now both input and output interface types are allowed to have multiple connections. && Added some utility methods to the Workflow_Editor class. && Implemented key response, users can now select nodes and connections with a bounding box and delete them using the Delete key. && Added a new node type for connector testing.
This commit is contained in:
@@ -26,9 +26,8 @@ protected:
|
||||
Connector_Type_Enum type; // 类型标识
|
||||
const char *socket_str; // 套接字字符串
|
||||
|
||||
Abs_Connector *provider; // 提供者
|
||||
std::vector<Abs_Connector *> receiver_list; // 接收方
|
||||
void *product; // 产物
|
||||
std::vector<Abs_Connector *> related_connector_list; // 关联列表
|
||||
void *product; // 产物(仅输出类节点持有)
|
||||
|
||||
public:
|
||||
// 显式禁用默认构造
|
||||
@@ -43,14 +42,17 @@ public:
|
||||
// 连接到目标连接点
|
||||
virtual bool Connect_To(Abs_Connector *target);
|
||||
|
||||
// 断开连接
|
||||
virtual void Disconnect(void);
|
||||
// 断开所有连接
|
||||
virtual void Disconnect_All(void);
|
||||
|
||||
// 与指定的接口断开连接
|
||||
virtual bool Disconnect_To(Abs_Connector *target);
|
||||
|
||||
// 注册产物
|
||||
virtual bool Register_Product(void *product, size_t size);
|
||||
|
||||
// 获取上级节点
|
||||
virtual Abs_Connector *Get_Provider(void);
|
||||
// 获取关联接口列表
|
||||
virtual std::vector<Abs_Connector *> Get_Related_List(void);
|
||||
|
||||
// 获取产物
|
||||
virtual void *Get_Product(void);
|
||||
@@ -70,6 +72,7 @@ protected:
|
||||
typedef enum
|
||||
{
|
||||
NODE_TYPE_UNKNOWN, // 未知节点类型
|
||||
NODE_TYPE_CONNECTOR_TEST, // 接口测试节点
|
||||
NODE_TYPE_MSG_LINE_INPUT, // 消息输入节点
|
||||
NODE_TYPE_CSV_EXPORTER, // CSV输出节点
|
||||
} Node_Type_Enum; // 节点类型枚举
|
||||
@@ -106,6 +109,9 @@ public:
|
||||
// 执行处理流程
|
||||
virtual bool Execute_Process(void) = 0;
|
||||
|
||||
// 获取ID
|
||||
virtual int Get_ID(void);
|
||||
|
||||
// 获取关闭信号
|
||||
virtual bool Get_CloseFlag(void);
|
||||
|
||||
|
||||
+24
-3
@@ -15,6 +15,7 @@ protected:
|
||||
typedef enum
|
||||
{
|
||||
NODE_TYPE_UNKNOWN, // 未知节点类型
|
||||
NODE_TYPE_CONNECTOR_TEST, // 接口测试节点
|
||||
NODE_TYPE_MSG_LINE_INPUT, // 消息输入节点
|
||||
NODE_TYPE_CSV_EXPORTER, // CSV输出节点
|
||||
} Node_Type_Enum; // 节点类型枚举
|
||||
@@ -46,13 +47,33 @@ protected:
|
||||
std::vector<std::vector<std::vector<std::shared_ptr<Abs_Node>>>> Process_Route; // 工作层级路由
|
||||
std::vector<std::shared_ptr<Abs_Node>> Separate_Node_List; // 散点列表
|
||||
|
||||
// =====================================函数声明=================================================
|
||||
// 新增节点 true -> success / false -> failed
|
||||
bool Add_Node(Node_Type_Enum type, ImVec2 initial_position = ImVec2(0, 0));
|
||||
// 删除节点 返回迭代器指定位置的下一个位置的迭代器,仅限内部使用
|
||||
std::vector<std::shared_ptr<Abs_Node>>::iterator Del_Node(std::vector<std::shared_ptr<Abs_Node>>::iterator iterator);
|
||||
|
||||
// 删除边 返回迭代器指定位置的下一个位置的迭代器,仅限内部使用
|
||||
std::vector<Edge>::iterator Del_Link(std::vector<Edge>::iterator iterator);
|
||||
|
||||
public:
|
||||
// 绘制节点编辑器
|
||||
void Show(void);
|
||||
|
||||
// 新增节点 true -> success / false -> failed
|
||||
bool Add_Node(Node_Type_Enum type, ImVec2 initial_position = ImVec2(0, 0));
|
||||
|
||||
// 删除节点 true -> success / false -> failed
|
||||
bool Del_Node(int target_node_id);
|
||||
|
||||
// 新增连接 true -> success / false -> failed
|
||||
bool Add_Link(int source_connector_id, int target_connector_id);
|
||||
|
||||
// 删除连接 true -> success / false -> failed
|
||||
bool Del_Link(int source_connector_id, int target_connector_id);
|
||||
|
||||
// 读取配置文件
|
||||
bool Read_Config(const char *file_path);
|
||||
|
||||
// 存储配置文件
|
||||
bool Store_Config(const char *file_path);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user