28 using Function = bool (*)(
Plot3D*, QString
const& fname);
42 virtual Functor* clone()
const = 0;
44 virtual bool operator()(
Plot3D* plot, QString
const& fname) = 0;
48 static bool defineInputHandler(QString
const& format, Function func);
50 static bool defineOutputHandler(QString
const& format, Function func);
52 static bool defineInputHandler(QString
const& format,
Functor const& func);
54 static bool defineOutputHandler(QString
const& format,
Functor const& func);
56 static bool save(
Plot3D*, QString
const& fname, QString
const& format);
58 static bool load(
Plot3D*, QString
const& fname, QString
const& format);
60 static QStringList inputFormatList();
62 static QStringList outputFormatList();
64 static Functor* outputHandler(QString
const& format);
66 static Functor* inputHandler(QString
const& format);
74 class Wrapper :
public Functor
78 Functor* clone()
const override
80 return new Wrapper(*
this);
83 explicit Wrapper(Function h) : hdl(h)
87 bool operator()(Plot3D* plot, QString
const& fname)
override
89 return (hdl) ? (*hdl)(plot, fname) : false;
101 Entry(Entry
const& e);
102 void operator=(Entry
const& e);
104 Entry(QString
const& s, Functor
const& f);
105 Entry(QString
const& s, Function f);
113 explicit FormatCompare(Entry
const& e);
114 bool operator()(Entry
const& e);
119 struct FormatCompare2
121 explicit FormatCompare2(QString s);
122 bool operator()(Entry
const& e);
127 using Container = std::vector< Entry >;
128 using IT = Container::iterator;
130 static bool add_unique(Container& l, Entry
const& e);
131 static IT find(Container& l, QString
const& fmt);
132 static Container& rlist();
133 static Container& wlist();
134 static void setupHandler();