summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/guide.cc
blob: b46c269290d39f17e40e4512d8308f8386be445f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*****
 * guide.cc
 * Andy Hammerlindl 2005/02/23
 *
 *****/

#include "guide.h"

namespace camp {

void multiguide::flatten(flatguide& g, bool allowsolve)
{
  size_t n=v.size();
  if(n > 0) {
    for(size_t i=0; i+1 < n; ++i) {
      v[i]->flatten(g,allowsolve);
      if(!allowsolve && v[i]->cyclic()) {
        g.precyclic(true);
        g.resolvecycle();
      }
    }
    v[n-1]->flatten(g,allowsolve);
  }
}

void multiguide::print(ostream& out) const
{
  side lastLoc=JOIN;
  for(size_t i=0; i < v.size(); ++i) {
    side loc=v[i]->printLocation();
    adjustLocation(out,lastLoc,loc);
    v[i]->print(out);
    lastLoc=loc;
  }
}

} // namespace camp