rogueviz::dhrg:: export some functions

This commit is contained in:
Zeno Rogue 2022-07-23 15:45:42 +02:00
parent 67267cbe6b
commit e9bb38d3b1
2 changed files with 20 additions and 6 deletions

View File

@ -123,6 +123,14 @@ int ts_coords;
int ts_vertices;
bool stored;
void graphv(string s) {
dhrg_init(); read_graph(s, true, true, true);
next_timestamp++;
ts_rogueviz = next_timestamp;
ts_rbase = next_timestamp;
stored = true;
}
int dhrgArgs() {
using namespace arg;
@ -141,11 +149,7 @@ int dhrgArgs() {
}
else if(argis("-graphv")) {
PHASE(3); shift(); dhrg_init(); read_graph(args(), true, true, true);
next_timestamp++;
ts_rogueviz = next_timestamp;
ts_rbase = next_timestamp;
stored = true;
PHASE(3); shift(); graphv(args());
}
else if(argis("-analyze_grid")) {
@ -286,4 +290,4 @@ auto hook =
#include "visualize.cpp"
#endif
}
}

View File

@ -79,4 +79,14 @@ namespace dhrg {
if(doStore) rogueviz::storeall();
}
void unsnap() {
for(int i=0; i<N; i++) {
using rogueviz::vdata;
transmatrix h = spin(coords[i].second * degree) * xpush(coords[i].first);
vdata[i].m->base = currentmap->gamestart();
vdata[i].m->at = h;
virtualRebase(vdata[i].m);
}
fixedges();
}
}