29 struct CustomNode :
public ImFlow::BaseNode
34 setStyle(ImFlow::NodeStyle::brown());
35 addIN<int>(
"in<int>",
"int", 0, ImFlow::ConnectionFilter::SameType(), ImFlow::PinStyle::red());
37 addOUT<int>(
"out<int>",
"int", ImFlow::PinStyle::blue())
46 struct Custom2Node :
public ImFlow::BaseNode
48 explicit Custom2Node()
51 setStyle(ImFlow::NodeStyle::brown());
52 addIN<int>(
"in<int>",
"int", 0, ImFlow::ConnectionFilter::SameType(), ImFlow::PinStyle::red());
53 addIN<float>(
"in<float>",
"float", 0, ImFlow::ConnectionFilter::SameType(), ImFlow::PinStyle::red());
55 addOUT<int>(
"out<int>",
"int", ImFlow::PinStyle::blue())
61 addOUT<float>(
"out<float>",
"float", ImFlow::PinStyle::blue())
72 ImGui::Text(
"%s",
"some text here");
78 auto callback = [
this]()
83 static ImGuiTextFilter filter_;
86 ImGui::DrawItemActivityOutline();
89 ImGui::BeginChild(
"COMPONENT_MENU_CONTEXT", ImVec2(ImGui::GetContentRegionAvail().
x,
size));
94 std::function<void()> factory;
97 std::vector<node_factory> nodes{
101 flow_.placeNode<CustomNode>();
106 flow_.placeNode<Custom2Node>();
110 for(
const auto& factory : nodes)
112 if(!filter_.PassFilter(factory.name.c_str()))
115 if(ImGui::Selectable(factory.name.c_str()))
119 ImGui::CloseCurrentPopup();
126 flow_.rightClickPopUpContent(
127 [
this, callback](ImFlow::BaseNode* node)
132 flow_.droppedLinkPopUpContent(
133 [
this, callback](ImFlow::Pin* dragged)
138 flow_.addNode<CustomNode>({});