37 using Function = bool (*)(
Plot3D*, QString
const& fname);
58 virtual Functor* clone()
const = 0;
60 virtual bool operator()(
Plot3D* plot, QString
const& fname) = 0;
64 static bool defineInputHandler(QString
const& format, Function func);
66 static bool defineOutputHandler(QString
const& format, Function func);
68 static bool defineInputHandler(QString
const& format,
Functor const& func);
70 static bool defineOutputHandler(QString
const& format,
Functor const& func);
72 static bool save(
Plot3D*, QString
const& fname, QString
const& format);
74 static bool load(
Plot3D*, QString
const& fname, QString
const& format);
76 static QStringList inputFormatList();
78 static QStringList outputFormatList();
80 static Functor* outputHandler(QString
const& format);
82 static Functor* inputHandler(QString
const& format);
90 class Wrapper :
public Functor
94 Functor* clone()
const
96 return new Wrapper(*
this);
99 explicit Wrapper(Function h) : hdl(h)
103 bool operator()(Plot3D* plot, QString
const& fname)
105 return (hdl) ? (*hdl)(plot, fname) : false;
117 Entry(Entry
const& e);
118 void operator=(Entry
const& e);
120 Entry(QString
const& s, Functor
const& f);
121 Entry(QString
const& s, Function f);
129 explicit FormatCompare(Entry
const& e);
130 bool operator()(Entry
const& e);
135 struct FormatCompare2
137 explicit FormatCompare2(QString s);
138 bool operator()(Entry
const& e);
143 using Container = std::vector< Entry >;
144 using IT = Container::iterator;
146 static bool add_unique(Container& l, Entry
const& e);
147 static IT find(Container& l, QString
const& fmt);
148 static Container& rlist();
149 static Container& wlist();
150 static void setupHandler();