ObjectCollection.h 1.37 KB
Newer Older
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
1
2
3
4
5
6
#ifndef _OBJECT_COLLECTION_H_
#define _OBJECT_COLLECTION_H_

#include <vector>
#include <string>
#include <map>
7
#include "simpleMesh.h"
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
8
9
10

class ObjectCollection {
  std::vector<float> radius, coordorig;
Matthieu Constant's avatar
Matthieu Constant committed
11
  std::vector<float> mass;
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
12
13
14
15
16
17
18
19
20
21
22
23
24
  std::vector<bool> fixed;
  std::vector<float> coord, segcoord, tricoord;
  std::vector<float> circleGeom;
  std::vector<std::string> _tagname;
  int dim;
  int _step;
  std::string _filename;
  double _shift[2], _scale, _rotation[2];
  bool _clip;
  void _compute_bbox(float bbox[6]);
  std::map<int, int> _visible_flag;
  FILE *_ffmpeg;
  std::string _basename;
25
26
27
  simpleMesh _mesh;
  simpleField _pressure;
  
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
 public :
  ObjectCollection(const std::string basename);
  ~ObjectCollection();
  int dimension() {return dim;}
  int step() const {return _step;}
  bool file_exists(int i);

  int read(int step = -1);
  void display();

  const std::string getTagName(size_t id) const;
  void shift(double dx, double dy);
  void zoom_at(double factor, double cx, double cy);
  void rotate(double r0, double r1);

  bool clip() const {return _clip;}
  void clip(bool c) {_clip = c;}

  std::map<int, int> &visible_flag() {return _visible_flag;}

48
#ifdef HAVE_LIBPNG
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
49
  void write_png(const char *file_name);
50
#endif
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
51
52
53
54
55
56
57
  void start_ffmpeg(const std::string filename);
  void stop_ffmpeg();

  void save_opt(const char *filename);
  void load_opt(const char *filename);
};
#endif