11 #ifndef __Pulsar_MultiDataPlot_h
12 #define __Pulsar_MultiDataPlot_h
14 #include "Pulsar/MultiData.h"
16 #include "Pulsar/SimplePlot.h"
17 #include "Pulsar/PlotFrame.h"
18 #include "Pulsar/MultiFrame.h"
19 #include "Pulsar/Archive.h"
48 std::vector< Reference::To<Type> > plots;
49 std::vector< Reference::To<const Archive> > data_sets;
66 managed_plot = simple;
74 the_plot->get_frame()->init (data);
77 cerr <<
"MultiDataPlot<Type>::plot call Type::prepare" << endl;
79 the_plot->prepare (data);
82 cerr <<
"MultiDataPlot<Type>::plot ptr=" << the_plot.ptr() << endl;
84 plots.push_back (the_plot);
85 data_sets.push_back (data);
88 Type* new_plot =
dynamic_cast<Type*
> (like.
ptr());
91 throw Error (InvalidState,
"Pulsar::MultiDataPlot<Type>::plot",
92 "Plot::Constructor::construct does not return a Type");
95 for (
unsigned i=0; i<options.size(); i++)
98 cerr <<
"Pulsar::MultiDataPlot<Type>::plot apply "
99 "'" << options[i] <<
"'" << endl;
100 new_plot->configure( options[i] );
111 cerr <<
"Pulsar::MultiDataPlot<Type>::finalize" << endl;
113 if (!data_sets.size())
116 Type* main_plot = plots[0];
118 for (
unsigned i=1; i < plots.size(); i++)
119 main_plot->get_frame()->include( plots[i]->get_frame() );
121 for (
unsigned i=0; i < plots.size(); i++)
123 plots[i]->get_frame()->copy( main_plot->get_frame() );
124 plots[i]->get_frame()->freeze();
127 for (
unsigned i=0; i < plots.size(); i++)
128 plots[i]->plot( data_sets[i] );