Skip to content

Instantly share code, notes, and snippets.

@tomlagier
Created July 3, 2017 05:12
Show Gist options
  • Save tomlagier/43d29095786462d2811d2772331377a2 to your computer and use it in GitHub Desktop.
Save tomlagier/43d29095786462d2811d2772331377a2 to your computer and use it in GitHub Desktop.
EMSCRIPTEN_BINDINGS(hierarchy) {
register_vector<HNode*>("VectorHNode");
class_<HBasis>("HBasis")
.property("x", &HBasis::x)
.property("y", &HBasis::y)
.property("r", &HBasis::r);
class_<HNode, base<HBasis>>("HNode")
.constructor<emscripten::val>()
.property("children", &HNode::children)
.property("value", &HNode::value)
.function("leaves", &HNode::leaves);
class_<Hierarchy>("Hierarchy")
.constructor(&createHierarchy)
.function("pack", &Hierarchy::pack, allow_raw_pointers());
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment