27 using Function = bool (*)(
Qwt3DPlot*, QString
const& fname);
41 virtual Functor* clone()
const = 0;
43 virtual bool operator()(
Qwt3DPlot* plot, QString
const& fname) = 0;
47 static bool defineInputHandler(QString
const& format, Function func);
49 static bool defineOutputHandler(QString
const& format, Function func);
51 static bool defineInputHandler(QString
const& format,
Functor const& func);
53 static bool defineOutputHandler(QString
const& format,
Functor const& func);
55 static bool save(
Qwt3DPlot*, QString
const& fname, QString
const& format);
57 static bool load(
Qwt3DPlot*, QString
const& fname, QString
const& format);
59 static QStringList inputFormatList();
61 static QStringList outputFormatList();
63 static Functor* outputHandler(QString
const& format);
65 static Functor* inputHandler(QString
const& format);
73 class Wrapper :
public Functor
77 Functor* clone()
const override
79 return new Wrapper(*
this);
82 explicit Wrapper(Function h) : hdl(h)
86 bool operator()(
Qwt3DPlot* plot, QString
const& fname)
override
88 return (hdl) ? (*hdl)(plot, fname) : false;
100 Entry(Entry
const& e);
101 void operator=(Entry
const& e);
103 Entry(QString
const& s, Functor
const& f);
104 Entry(QString
const& s, Function f);
112 explicit FormatCompare(Entry
const& e);
113 bool operator()(Entry
const& e);
118 struct FormatCompare2
120 explicit FormatCompare2(QString s);
121 bool operator()(Entry
const& e);
126 using Container = std::vector< Entry >;
127 using IT = Container::iterator;
129 static bool add_unique(Container& l, Entry
const& e);
130 static IT find(Container& l, QString
const& fmt);
131 static Container& rlist();
132 static Container& wlist();
133 static void setupHandler();