Giter Site home page Giter Site logo

pomelonodeseditor's Introduction

PomeloNodesEditor

基于 ImGui 和 ImNodes 改进的节点编辑器.

  • 依赖图形库: OpenGL GLFW(3.2+) GLEW
  • 依赖GUI库: ImGui ImNodes
  • 依赖Json解析库: RapidJSON

编辑器初始化 ImGui 和 ImNodes

void PNEinit::initialization_imgui(
        PNEinit::imguiinit(
            const char*,      // OpenGL 着色器版本 ("#version 330", "#version 460"). 
            const char*,      // ImGui  字体路径 (.ttf).
            float,            // ImGui  字体大小.
            STYLE_TYPE_CYAN   // 编辑器颜色主题(基于 ImGui.Dark) STYLE_TYPE_ORANGE, STYLE_TYPE_PINK
            ), 
        GLFWwindow*           // GLFW 窗口对象.
);

void PNEinit::initialization_imnodes(void);

加载节点组件配置文件

bool PNEpreset::component_load(const char*); // json 配置文件路径.

绘制GUI, 如果还有其他ImGui的窗口需要绘制, 可直接lambda中编写无需ImGui帧绘制函数. "drawflag" 为绘制节点编辑器(ImNodes)标志 FALSE 即不会绘制编辑器.

PNErender::rendertick_gui(drawflag, []() {

        PNEpreset::component_guipanel();

	// ImGui::Begin("Test");
	// ImGui::Text("Hello World");
	// ImGui::End();

    });

提供了一个简易的组件面板, 以便测试.

void PNEpreset::component_guipanel();

编辑器ImGui和ImNodes的释放.

void PNEclose::close_imgui();
void PNEclose::close_imnodes();

获取节点编辑器 节点数据 互联数据. nodes data vector, links data hash_map. 具体参考 pomelo_node_editor.h 92-140 lins

void PNEGET_node_link_data(
	std::vector<pne_node_component::node_attribute>&                 node_data,
	std::unordered_map<int32_t, pne_node_component::node_link_line>& link_data
);

持续更新中...

孩子不懂事写着玩大佬勿喷()

pomelonodeseditor's People

Contributors

rcszc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.