diff --git a/src/geoflow/core_nodes.hpp b/src/geoflow/core_nodes.hpp index 233885f..7f87e99 100644 --- a/src/geoflow/core_nodes.hpp +++ b/src/geoflow/core_nodes.hpp @@ -211,6 +211,7 @@ namespace geoflow::nodes::core { vector_output(node_name+"."+term_name).push_back_any(data); } } else { + std::cout << "pushing empty any for " << node_name+"."+term_name << "at i=" << i << std::endl; vector_output(node_name+"."+term_name).push_back_any(std::any()); } } else { diff --git a/src/geoflow/geoflow.cpp b/src/geoflow/geoflow.cpp index 698c57f..f7efaaa 100644 --- a/src/geoflow/geoflow.cpp +++ b/src/geoflow/geoflow.cpp @@ -104,7 +104,7 @@ const std::vector& gfSingleFeatureInputTerminal::get_data_vec() const auto sot = (gfSingleFeatureOutputTerminal*)(output_term.get()); return sot->get_data_vec(); } -size_t gfSingleFeatureInputTerminal::size() { +size_t gfSingleFeatureInputTerminal::size() const { auto output_term = connected_output_.lock(); auto sot = (gfSingleFeatureOutputTerminal*)(output_term.get()); return sot->size(); @@ -255,7 +255,7 @@ bool gfMultiFeatureInputTerminal::is_touched() { } return false; } -size_t gfMultiFeatureInputTerminal::size() { +size_t gfMultiFeatureInputTerminal::size() const{ if (connected_outputs_.size()==0) return 0; else @@ -279,7 +279,7 @@ bool gfMultiFeatureOutputTerminal::has_data() const { } return true; } -size_t gfMultiFeatureOutputTerminal::size() { +size_t gfMultiFeatureOutputTerminal::size() const { if (terminals_.size()==0) return 0; else diff --git a/src/geoflow/geoflow.hpp b/src/geoflow/geoflow.hpp index 7f21451..449ff82 100644 --- a/src/geoflow/geoflow.hpp +++ b/src/geoflow/geoflow.hpp @@ -139,7 +139,7 @@ namespace geoflow { } const gfIO get_side() { return GF_IN; }; bool is_optional() { return is_optional_; }; - virtual size_t size() = 0; + virtual size_t size() const = 0; friend class gfOutputTerminal; friend class gfSingleFeatureOutputTerminal; @@ -170,7 +170,7 @@ namespace geoflow { const gfTerminalFamily get_family() { return GF_SINGLE_FEATURE; }; template const T get(size_t i); const std::vector& get_data_vec() const; - size_t size(); + size_t size() const; friend class gfSingleFeatureOutputTerminal; }; @@ -202,7 +202,7 @@ namespace geoflow { void connect(gfInputTerminal& in); void disconnect(gfInputTerminal& in); - virtual size_t size()=0; + virtual size_t size() const=0; void set_type(std::type_index type) {types_ = {type}; } void touch() { is_touched_=true; }; @@ -265,7 +265,7 @@ namespace geoflow { } // multi element - size_t size() { return data_.size(); }; + size_t size() const { return data_.size(); }; templatevoid resize(size_t n) { return data_.resize(n, T()); }; @@ -329,7 +329,7 @@ namespace geoflow { bool has_data() const; bool is_touched(); bool has_connection() {return connected_outputs_.size() > 0; }; - size_t size(); + size_t size() const; const SubTermRefs& sub_terminals() { return sub_terminals_; }; // const BasicRefs& basic_terminals() { return basic_terminals_; }; @@ -357,7 +357,7 @@ namespace geoflow { using gfOutputTerminal::gfOutputTerminal; const gfTerminalFamily get_family() { return GF_MULTI_FEATURE; }; bool has_data() const; - size_t size(); + size_t size() const; // note these 2 are almost the same now: gfSingleFeatureOutputTerminal& add(std::string term_name, std::type_index ttype ) ; diff --git a/src/geoflow/gui/ImNodesEz.cpp b/src/geoflow/gui/ImNodesEz.cpp index cbc79ec..a22dd46 100644 --- a/src/geoflow/gui/ImNodesEz.cpp +++ b/src/geoflow/gui/ImNodesEz.cpp @@ -160,9 +160,23 @@ bool Slot(geoflow::gfTerminal* term, int kind) ImGui::SameLine(); ImGui::Text("(size: %lu)", ot->size()); } } - } else if (term->get_family()==geoflow::GF_MULTI_FEATURE ) - ImGui::TextUnformatted("Family: Multi Feature"); - else + } else if (term->get_family()==geoflow::GF_MULTI_FEATURE ) { + if(term->get_side()==geoflow::GF_IN) { + ImGui::TextUnformatted("Family: Multi Feature"); + auto* it = (geoflow::gfMultiFeatureInputTerminal*) term; + for (auto& subterm : it->sub_terminals()) { + ImGui::Text(" %lu %s, ", subterm->size(), subterm->get_name().c_str()); + // ImGui::Text(" %s)", subterm->get_type().name()); + } + } else { + ImGui::TextUnformatted("Family: Multi Feature"); + auto* it = (geoflow::gfMultiFeatureOutputTerminal*) term; + for (auto& [name, subterm] : it->sub_terminals()) { + ImGui::Text(" %lu %s, ", subterm->size(), subterm->get_name().c_str()); + // ImGui::Text(" %s)", subterm->get_type().name()); + } + } + } else ImGui::TextUnformatted("Family: Unknown"); ImGui::Text("Compatible types:");