QNANO
Postscript_Printer.h
1 #ifndef QNANO_NEW_POSTSCRIPT_PRINTER_DEFINED_H
2 #define QNANO_NEW_POSTSCRIPT_PRINTER_DEFINED_H
3 
4 #include "structure/Atom_List.h"
5 #include "structure/Potential.h"
6 #include "tools/Quaternion.h"
7 #include <fstream>
8 #include <iomanip>
9 
11 private:
12  std::string outfile;
13  double boxwidth, boxheight;
14  bool ps_boxwidth_set_explicitly;
15  bool ps_boxheight_set_explicitly;
16  bool print_diagonal;
17 
18  //cut box:
19  Vec3d center;
20  double boxwidthx, boxwidthy, boxwidthz;
21  Quaternion quaternion;
22 
23  double nm_to_pt;
24  double default_radius;
25  double atom_border_width;
26  std::vector<std::string> EVfile;
27  std::string potentialfile;
28 
29  std::map<int, Vec3d> element_color;
30 
31  //function pointer to color rescale function
32  Vec3d (*color_rescale)(Vec3d color, double maxval);
33 
34 public:
35  bool is_in_box(const Atom &at, const Vec3d &newcenter)const;
36 // Atom_List cut_rotate_project(const Atom_List &atlist)const;
37 
38  void set_element_colors_from_parameters(Parameter_Map &param_map);
39  void add_default_element_colors(std::map<int,Vec3d> &colors, const Atom_List &atlist)const;
40 
41  static Vec3d color_rescale_bw(Vec3d color, double maxval);
42  static Vec3d color_rescale_yellowbrown(Vec3d color, double maxval);
43  static Vec3d color_rescale_redblue(Vec3d color, double maxval);
44  static Vec3d color_rescale_greenredblueyellow(Vec3d color, double maxval);
45 
46 
47  void get_color_list_atoms(std::vector<Vec3d> & colorlist, const Atom_List &atlist)const;
48  void get_color_list_EV(std::vector<Vec3d> & colorlist, const Atom_List &atlist)const;
49  void get_color_list_potential(std::vector<Vec3d> & colorlist, const Atom_List &atlist)const;
50  void get_color_list(std::vector<Vec3d> & colorlist, const Atom_List &atlist)const;
51  void setup_from_parameters(Parameter_Map &param_map);
52 
53  void print_header(std::ostream &ofs) const;
54  void print_footer(std::ostream &ofs) const;
55  void print_atoms(std::ostream &ofs, const Atom_List &atlist)const;
56  void print(const Atom_List &atlist);
57 // void print(const Sample &sample);
58 
59  Postscript_Printer(const std::string &outfile);
62 
63  static bool compare_atom_z(const Atom &a1, const Atom &a2){
64  return a1.pos[2]<a2.pos[2];
65  }
66 };
67 
68 #endif
Definition: Quaternion.h:10
Definition: Parameter_Map.h:12
Class to store positions and to handle operations on 3d vectors.
Definition: Vec3d.h:9
Definition: Atom_List.h:9
Definition: Postscript_Printer.h:10
Definition: Atom.h:6