コード例 #1
0
static vector<Segment> segmentsFromBranch(const Branch& branch) {
  vector<Segment> segments = branch.body();
  for (const auto& childBranch : branch.branches()) {
    auto branchSegments = segmentsFromBranch(childBranch);
    move(begin(branchSegments), end(branchSegments), back_inserter(segments));
  }
  return segments;
}
コード例 #2
0
void WireFrameTreeRenderer::drawBranch(const Branch& branch, ID2D1DeviceContext2& context) {
  drawSegments(branch.body(), context);
  drawBranches(branch.branches(), context);
  drawLeaves(branch.leaves(), context);
}