Example #1
0
int main(int argc, char **argv)
{
  if (argc < 3) {
    fprintf(stderr, "Usage: %s <dataname> <ts> <tl>\n", argv[0]);
    return EXIT_FAILURE;
  }
  
  const std::string dataname = argv[1];
  const int ts = atoi(argv[2]), 
            tl = atoi(argv[3]), 
            span = 1;

  QApplication app(argc, argv); 

  QGLFormat fmt = QGLFormat::defaultFormat();
  fmt.setSampleBuffers(true);
  fmt.setSamples(16); 
  QGLFormat::setDefaultFormat(fmt); 
  
  VortexTransition vt;
  vt.LoadFromFile(dataname, ts, tl);
  vt.ConstructSequence();

  CStorylineWidget *widget = new CStorylineWidget;
  widget->SetVortexTrasition(&vt);
  widget->show();

  return app.exec(); 
}
Example #2
0
int main(int argc, char **argv)
{
  if (argc < 8) {
    fprintf(stderr, "Usage: %s <dataname> <ts> <tl> <gvid0> <gvid1> <gvid2> <gvid3>\n", argv[0]);
    return EXIT_FAILURE;
  }

  const std::string dataname = argv[1];
  const int ts = atoi(argv[2]), 
            tl = atoi(argv[3]);
  const int gvid0 = atoi(argv[4]), 
            gvid1 = atoi(argv[5]), 
            gvid2 = atoi(argv[6]), 
            gvid3 = atoi(argv[7]);

  LoadTimesteps(dataname);

  VortexTransition vt;
  vt.LoadFromFile(dataname, ts, tl);
  vt.ConstructSequence();
  // vt.PrintSequence();

  for (int frame=ts; frame<ts+tl; frame++) {
    float dist;
    const int lvid0 = vt.gvid2lvid(frame, gvid0), 
              lvid1 = vt.gvid2lvid(frame, gvid1), 
              lvid2 = vt.gvid2lvid(frame, gvid2), 
              lvid3 = vt.gvid2lvid(frame, gvid3); 
    if (lvid0 != -1 && lvid1 != -1) 
      dist = Dist(dataname, frame, lvid0, lvid1);
    else if (lvid2 != -1 && lvid3 != -1)
      dist = Dist(dataname, frame, lvid2, lvid3);
    else 
      dist = -DBL_MAX;

    if (dist >= 0)
      fprintf(stderr, "%d, %f, %f\n", frame, timesteps[frame], dist);
  }

  return 0;
}