20 #include "msdevstudio/MSconfig.h"
23 #endif // HAVE_CONFIG_H
87 using namespace hippodraw;
109 const vector < string > &
115 return factory -> names ();
123 BinToColor * model = factory -> create ( name );
125 plotter -> setValueRep ( model );
133 const vector < string > & names = factory -> names ();
134 BinToColor * rep = factory -> create ( names[index] );
136 plotter -> setValueRep ( rep );
142 const std::vector < double > & ctrl_points )
145 model -> setControlPoints ( ctrl_points );
148 factory -> add ( model );
156 BinToColor * prototype = factory -> prototype ( name );
157 bool yes = prototype -> isUserDefined ();
159 factory ->
remove ( name );
165 const vector <double > &
170 return r -> getControlPoints ();
176 const std::vector < double > & sv)
180 r -> setControlPoints ( sv );
181 DataRep * datarep = plotter -> selectedDataRep ();
182 datarep -> notifyObservers ();
189 const std::vector <double> & sv)
193 const std::string transformName = r->
name();
205 const BinToColor * rep = plotter -> getValueRep ();
207 const string & name = rep -> name ();
209 unsigned int size = names.size();
210 for (
unsigned int i = 0; i <
size; i++ ) {
211 if ( name == names[i] ) {
226 const BinToColor * rep = plotter -> getValueRep ();
239 const BinToColor * rep = plotter -> getValueRep ();
241 yes = rep -> isUserDefined ();
247 const vector < string > &
253 return factory -> names ();
261 DataRep * rep = controller -> createDataRep ( name );
272 string what (
"DisplayController: data rep of type " );
273 what += rep -> name();
274 what +=
"\nhas NTuple bindings.\n";
275 what +=
"Can not create without them";
281 plotter -> setAutoRanging (
true );
293 const std::vector< std::string > & bindings )
const
300 assert ( proto != 0 );
303 addDataRep ( plotter, name, &tuple, bindings );
305 if ( proto -> needsMatrixSet () ) {
307 controller -> checkForImage ( plotter, tuple );
311 plotter -> autoScale ();
322 unsigned int size = ntuple -> rows ();
324 vector < double > values ( size );
325 vector < double > residuals ( size );
326 DataRep * data1 = plotter -> getDataRep(0);
327 DataRep * data2 = plotter -> getDataRep(1);
331 vector < double > & x1 = ntuple1 -> getColumn ( 0 );
332 vector < double > & y1 = ntuple1 -> getColumn ( 1 );
333 vector < double > & deltaX1 = ntuple1 -> getColumn (2);
335 vector < double > & x2 = ntuple2 -> getColumn ( 0 );
336 vector < double > & y2 = ntuple2 -> getColumn ( 1 );
337 vector < double > & deltaX2 = ntuple2 -> getColumn (2);
339 vector <double> xDiff;
340 vector <double> yDiff;
341 vector <double> deltaXDiff;
342 vector <double> deltaYDiff;
346 while( i < x1.size() && j < x2.size() ) {
347 if (x1[i] + deltaX1[i] == x2[j] + deltaX2[j]) {
348 if ( xDiff.empty()) {
349 xDiff.push_back(x1[i]);
350 yDiff.push_back(y2[j] - y1[i]);
351 deltaXDiff.push_back(deltaX1[i]);
356 double tmpX = xDiff.back();
357 double tmpDeltaX = deltaXDiff.back();
358 double xLeft = tmpX + tmpDeltaX;
359 double xRight = x1[i] + deltaX1[i];
360 xDiff.push_back(xLeft+0.5*(xRight - xLeft));
361 yDiff.push_back(y2[j] - y1[i]);
362 deltaXDiff.push_back(0.5*(xRight - xLeft));
368 else if (x1[i] + deltaX1[i] < x2[j] + deltaX2[j]) {
369 if ( xDiff.empty()) {
370 xDiff.push_back(x1[i]);
371 yDiff.push_back(y2[j] - y1[i]);
372 deltaXDiff.push_back(deltaX1[i]);
376 double tmpX = xDiff.back();
377 double tmpDeltaX = deltaXDiff.back();
378 double xLeft = tmpX + tmpDeltaX;
379 double xRight = x1[i] + deltaX1[i];
380 xDiff.push_back(xLeft+0.5*(xRight - xLeft));
381 yDiff.push_back(y2[j] - y1[i]);
382 deltaXDiff.push_back(0.5*(xRight - xLeft));
387 if ( xDiff.empty() ) {
388 xDiff.push_back(x2[j]);
389 yDiff.push_back(y2[j] - y1[i]);
390 deltaXDiff.push_back(deltaX2[j]);
394 double tmpX = xDiff.back();
395 double tmpDeltaX = deltaXDiff.back();
396 double xLeft = tmpX + tmpDeltaX;
397 double xRight = x2[j] + deltaX2[j];
398 xDiff.push_back(xLeft+0.5*(xRight - xLeft));
399 yDiff.push_back(y2[j] - y1[i]);
400 deltaXDiff.push_back(0.5*(xRight - xLeft));
409 newNtuple->
addColumn (
"Residuals", yDiff );
410 newNtuple->
addColumn (
"DeltaX", deltaXDiff );
422 ntuple -> setTitle ( plotter -> getTitle () );
426 vector < string > bindings ( 3 );
428 bindings[0] = ntuple -> getLabelAt ( 0 );
429 bindings[1] = ntuple -> getLabelAt ( 1 );
430 bindings[2] = ntuple -> getLabelAt ( 2 );
438 controller->
setLog( new_plotter,
"x",
439 controller ->
getLog( plotter,
"x" ) );
450 plotter = factory -> create (
"XyPlotter" );
451 if ( rep -> hasAxis (
Axes::Z ) ) {
452 plotter -> setEnableZ (
true );
466 const std::string &
type,
468 const std::vector < std::string > & bindings )
const
471 if ( ! yes )
return 0;
491 const std::string &
type,
493 const std::vector < std::string > & bindings )
const
496 if ( ! yes )
return 0;
540 if ( plotter -> getNumDataReps () > 0 ) {
557 const std::string & datarep )
const
564 if ( proto -> hasAxis (
Axes::Z ) ) {
575 #ifdef ITERATOR_MEMBER_DEFECT
578 vector < const ViewBase * > ::const_iterator iter = views.begin();
580 while ( iter != views.end() ) {
585 const ViewBase * curview = ( * iter++ );
604 const std::vector < const ViewBase * > & src )
606 std::vector < const ViewBase * > ::const_iterator first = src.begin();
607 while ( first != src.end() ) {
610 vector < const ViewBase * > :: iterator i
611 = find ( dest.begin(), dest.end (), view );
612 if ( i != dest.end() )
continue;
616 if ( text_plotter == 0 )
continue;
619 bool add_to_list =
false;
620 for ( i = dest.begin (); i != dest.end(); ++i ) {
623 if ( plotter == 0 )
continue;
625 for (
int j = 0; j < num; j++ ) {
627 if ( rep == datarep ) {
632 if ( add_to_list )
break;
634 if ( add_to_list ) dest.push_back ( view );
641 const std::string & axis )
660 const std::string & name,
661 const std::string & text)
666 assert ( view != 0 );
674 const vector < string > &
680 return text_factory->
names ();
684 const std::string & text)
688 assert ( textrep != 0 );
698 const std::string & name,
699 const std::string & text)
711 const std::string & name,
712 const std::string & text)
737 rep = plotter -> getDataRep ( index );
747 plotter -> setActivePlot ( index,
true );
750 const vector < string > &
763 const vector < string > &
773 const vector < string > &
778 DataRep * rep = factory -> prototype ( type );
784 const vector < string > &
788 assert ( index < plotter->getNumDataReps () );
804 assert ( index < plotter->getNumDataReps () );
815 assert ( index < plotter->getNumDataReps () );
824 assert ( index < plotter->getNumDataReps () );
832 const std::string & axis,
int index )
const
845 assert ( index < plotter -> getNumDataReps () );
855 const std::string & axis,
int index )
const
859 return getRMS ( plotter, a, index );
868 assert ( index < plotter -> getNumDataReps () );
872 return projector ->
getRMS ( axis );
880 return datarep->
name ();
888 if ( datarep == 0 )
return 0;
900 if ( projbase != 0 ) {
910 for (
int i = 0; i < number; i++ ) {
913 if ( frep != 0 )
continue;
914 if ( projbase == 0 ) {
928 const NTuple * ntuple )
const
931 if ( projector == 0 )
return;
946 int numDataReps = plotter -> getNumDataReps ();
947 if ( index >= 0 || numDataReps < 2 ) {
952 for (
int i = 1; i< numDataReps; i++ ) {
954 if ( source != nt ) {
973 if ( projector != 0 ) {
974 source = projector -> getNTuple ();
1010 for (
int i = 0; i < number; i++ ) {
1025 for (
int i = 0; i < number; i++ ) {
1027 if ( source != 0 ) {
1028 yes = controller -> isFromFile ( source );
1030 if ( yes ==
false )
break;
1039 assert ( ! ( index < 0 ) );
1052 return source -> getName ();
1055 const vector < string > &
1074 int active = plotter -> activePlotIndex ();
1078 int number = plotter -> getNumDataReps ();
1079 for (
int i = 0; i < number; i++ ) {
1080 DataRep * trep = plotter -> getDataRep ( i );
1104 const std::string & axis,
1105 const std::string & label )
1107 DataRep * rep = plotter -> getTarget ();
1112 if ( axis[0] ==
'Y' ) a =
Axes::Y;
1113 plotter -> setAutoRanging ( a,
true );
1114 plotter -> autoScale ();
1120 const std::vector< std::string > & labels )
const
1123 if ( projector == 0 )
return;
1135 const DataRep * rep = plotter -> getTarget ();
1151 if ( projector != 0 ) {
1161 const std::string & axis)
const
1164 return getLog ( plotter, at );
1177 if ( xy_transform == 0 )
return false;
1191 assert ( transform );
1193 const string & name = transform->
name ();
1195 return name ==
"Log";
1207 if ( projector == 0 )
return;
1212 const Range & range = plotter -> getRange ( axis,
false );
1218 if ( model->
isLog() ) {
1219 binner = binner_factory -> create (
"BinnerLog" );
1221 binner = binner_factory -> create (
"BinnerLinear" );
1237 for (
int i = 0; i < number; i++ ) {
1248 const std::string &
type )
1255 if ( type ==
"Linear" ) {
1257 if ( !( model->
isLog() ) )
return;
1261 else if ( type ==
"Log" ) {
1263 if ( model->
isLog () )
return;
1264 const Range & range = plotter -> getRange ( axis,
false );
1265 if ( range.
high() < 0. ) {
1266 string what (
"Can not change axis to log scale since current "
1267 "range is negative" );
1268 throw std::runtime_error ( what );
1279 swap ( temp, model );
1293 const std::string & axis,
1297 setLog ( plotter, at, flag );
1313 if ( xy_transform != 0 ) {
1314 setLog ( plotter, axis, flag, xy_transform );
1321 if ( flag ) type =
"Log";
1322 else type =
"Linear";
1327 TransformBase * transform = factory -> createTransform ( type );
1329 b_transform -> setZTransform ( transform );
1342 string x_trans = transform->
name ();
1344 string y_trans = transform->
name ();
1346 string z_trans = transform->
name ();
1381 string t_name = x_trans;
1394 const std::string & name )
1409 const std::string & x,
1410 const std::string & y )
1413 const string name = x +
" " + y;
1430 return rep->
size ();
1437 RepBase * rep = plotter -> representation ();
1449 RepBase * rep = plotter -> representation ();
1452 if ( colrep != 0 ) {
1467 RepBase * rep = plotter -> representation ();
1469 return rep -> getStyle ();
1485 DataRep * datarep = plotter -> getDataRep ( index );
1488 RepBase * rep = factory -> create ( point_rep );
1497 const Range & range )
1507 const std::string & axis,
1521 const list < Observer * > & obs_list = datarep -> getObservers ();
1522 list < Observer * >::const_iterator first = obs_list.begin();
1523 while ( first != obs_list.end () ) {
1526 if ( plotter != 0 ) {
1527 plotter -> autoScale ();
1529 plotter -> setAutoRanging ( axis,
false );
1552 const std::string & axis,
1556 bool widths_are_same =
false;
1559 if ( axis ==
"Y" ) at =
Axes::Y;
1560 if ( axis ==
"Z" ) at =
Axes::Z;
1567 for (
int i = 0; i < number; i++ ) {
1569 projector->
setOffset ( axis, parm, dragging );
1572 widths_are_same =
true;
1576 projector->
setOffset ( axis, parm, dragging );
1587 bool widths_are_same =
false;
1593 for (
int i = 0; i < number; i++ ) {
1598 widths_are_same =
true;
1615 DataRep * rep = plotter -> getDataRep ( index );
1616 rep -> setErrorDisplay ( axis, state );
1624 int index = plotter -> activePlotIndex ();
1634 const std::string & x,
1635 const std::string & y)
1646 const std::string &
type )
1653 if ( type ==
"Linear" ) {
1655 if ( !( model->
isLog() ) )
return;
1659 else if ( type ==
"Log" ) {
1661 if ( model->
isLog () )
return;
1662 const Range & range = plotter -> getRange ( axis,
false );
1663 if ( range.
high () < 0. ) {
1664 string what (
"Can not change axis to Log scale since current "
1665 "range is negative." );
1666 throw std::runtime_error ( what );
1676 swap ( temp, model );
void setParentDataRep(hippodraw::DataRep *)
Sets the target DataRep of its own TextDataRep object.
static DataRepFactory * instance()
Returns the pointer to the singleton instance.
Part of an implementation of the Observable Observer pattern based on the example implementation in t...
const std::string & name() const
Returns the name of the Transform.
void setRepSize(PlotterBase *plotter, float size)
Sets the size of the representation.
bool isUserDefinedValueTransform(const PlotterBase *plotter) const
Returns true if value to color transform is user defined.
virtual bool isAxisBinned(const std::string &axis) const
Returns true if specified axis is binned.
A transform that transforms the X and Y coordinates independently.
void setRangePos(double)
The function which changes the pos member of m_range.
hippodraw::TextRepBase class interface
static BinnerAxisFactory * instance()
Returns a pointer to the singleton instance.
static DataSourceController * instance()
Returns the pointer to the singleton instance.
void setIntervalCount(const PlotterBase *plotter, unsigned int count)
Sets the interval count on the the NTuple of the active DataRep of the plotter.
virtual ProjectorBase * activeProjector() const
Returns the active projector.
const std::vector< double > & getValueCtrlPts(const PlotterBase *plotter)
Returns the control points of the value to color transform model.
~DisplayController()
The destructor.
void setTransform(PlotterBase *plotter, const std::string &name)
Creates and sets a new transform for the display.
The abstract base class for views.
TextPlotter class interface.
PlotterBase * createPlotter(const hippodraw::DataRep *rep) const
Returns a newly created PlotterBase object.
The base class for the Projector hierarchy.
virtual void setParentPlotter(PlotterBase *plotter)
Sets the parent plotter.
A PointRep class that draws a column to represent the value.
hippodraw::BinToColorScaleMovingBrkPt class interface
hippodraw::NTupleController class interface
void addDataRep(PlotterBase *, hippodraw::DataRep *) const
Adds the DataRep to the PlotterBase object by including it.
void setValueTransform(PlotterBase *plotter, const std::string &name)
Sets the value to color transform model.
A derived class of DataRep which displays a value as a line along the X or Y axis.
A Controller class for FITS files.
virtual void checkAxisScaling()
Check if Axis needs to be scaled or not.
DataSourceController class interface.
Type * create(const std::string &name)
Creates a new object from a prototype named name.
void setAxisModelWithoutSetBin(PlotterBase *plotter, Axes::Type axis, const std::string &type)
set the axis to log or linear, without reseting the bin width.
virtual void setNTuple(const DataSource *source)
Changes the DataSource used for the projections to source.
void removeTextObservers(const std::vector< const ViewBase * > &views)
Removes TextRep Observer objects, if any, from its target.
int getUniqueNonFunctionIndex(const PlotterBase *plotter) const
Returns the index to an unique DataRep object that is not a FunctionRep.
static DataRepController * instance()
Returns the pointer to the singleton instance.
void setValueCtrlPts(PlotterBase *plotter, const std::vector< double > &sv)
Sets the control points for the value to color transform model.
void remove(PlotterBase *)
Deletes a PlotterBase object.
A PointRep class that draws a column to represent the value.
NTupleProjector * getBindingProjector(const PlotterBase *) const
Returns projector that supports binding, if display has one, otherwise returns null pointer...
static BinToColorFactory * instance()
Returns a pointer to the singleton instance.
hippodraw::ColumnPointRep class interface
static TransformFactory * instance()
Returns a pointer to the singleton instance.
double high() const
Returns the maximum of the range object.
NTuple * createNTupleDiff(PlotterBase *plotter)
The singleton Factory class for creating objects whose class is derived from TransformBase.
An NTupleProjector is a projector that projects data from an DataSource object.
int getOverflow(const PlotterBase *plotter, int index=0) const
Returns the number of overflow.
virtual const Range & setRange(const Range &, bool hold_width=true)=0
Sets the range.
virtual ProjectorBase * getProjector() const
Returns the Projector object controlling the data.
TransformBase * zTransform() const
Returns the transform function on the Z axis.
static DisplayController * s_instance
The pointer to the singleton object.
void setBinWidth(PlotterBase *plotter, Axes::Type axis, double width)
Sets the bin width parameter.
hippodraw::NTupleProjector class interface
A factory for creation of objects whose class is derived from BinToColor.
bool isAxisBinned(PlotterBase *display, const std::string &axis)
Tests if specified axis is binned.
const std::string & name() const
Returns the name of the value to color transform.
int activeDataRepIndex(const PlotterBase *plotter) const
Returns the active DataRep index for the DataRep objects contained in the plotter.
const std::string & getType(const PlotterBase *plotter, int index) const
Returns the type of DataRep contained in the plotter at index index.
void setAxisBinding(PlotterBase *, const std::string &axis, const std::string &label)
Sets the axis binding, if any, otherwise does nothing.
virtual DataRep * selectedDataRep() const
Returns the selected DataRep.
StripChart class interface.
hippodraw::DataRep * addDataRepStacked(PlotterBase *plotter, const std::string &name, const DataSource *source, const std::vector< std::string > &bindings) const
Creates a new DataRep object with class name name and adds it to the existing plotter by stacking it...
Expresses a range of values.
virtual void setTransform(TransformBase *)
Sets the transform object.
hippodraw::LinePointRep class interface
void setIntervalCount(int number)
Sets the interval count.
virtual ProjectorBase * getProjector(int i) const
Returns the projector at index i.
bool getLog(const PlotterBase *plotter, const std::string &axis) const
Returns true if the designated axis is on a logarithmic scale.
void setOffset(PlotterBase *plotter, const std::string &axis, int parm, bool dragging)
Sets the offset from dragging slider.
BinToColorFactory class interface.
Base class for DataSource.
static PointRepFactory * instance()
Returns a pointer to the singleton instance.
const std::vector< std::string > & getDataSourceLabels(const PlotterBase *plotter, int index)
Returns the labels of the DataSource columns for the DataRep contained in the plotter at index index...
float pointSize(const PlotterBase *) const
Returns the size of the representation.
virtual bool hasAxis(Axes::Type axis) const
Returns true if the plotter has an axis of specified type.
PlotterBase * getPlotter() const
Returns the plotter used by this view.
bool hasLineRep(const PlotterBase *plotter) const
Returns true if active DataRep uses LinePointRep, otherwise returns false.
virtual void notifyObservers() const
Notifies Observer objects of a change.
Given a range, calculates a model for an axis with a log scale.
A Plotter class that plots points in 2 dimensions and option a third dimension in color...
void setRepSize(double size)
Sets the size of the representation.
BinToMovingBrkPt class interface.
virtual const std::vector< std::string > & getLabels() const
Returns the list of available labels.
hippodraw::ViewBase class interface
Displays data in textual representation.
virtual unsigned int rows() const
Returns the number of rows.
static FitsController * instance()
Returns the singleton instance of the FitsController.
DisplayController class interface declaration.
virtual void addDataRep(DataRep *rep)
Adds a DataRep object to the plotter.
DisplayController()
A default constructor for avoiding creation except by itself or with derived classes.
hippodraw::BinnerAxis class interface
LineDataRep * addLineRep(PlotterBase *, const std::string &axis, double value)
Adds a LineDataRep to the Plotter object.
The base class for the point representation hierarchy.
TransformBase * xTransform() const
Returns the transform function on the X axis.
LineDataRep class interface.
bool hasSymbolRep(const PlotterBase *plotter) const
Returns true if active DataRep uses SymbolPointRep, otherwise returns false.
virtual void setRange(Axes::Type axis, const Range &range, bool scaled=false, bool adjust_width=true)
Sets the range on the specified axis.
PyArray_TYPES type(numeric::array arr)
A factory for textual representations.
hippodraw::DataRep * getUniqueWithNTupleBindings(const PlotterBase *plotter)
Returns the unique DataRep.
virtual ViewBase * createView(PlotterBase *plotter) const =0
Creates a view for the plotter.
virtual bool hasNTupleBindings() const
Returns true if the DataRep's projector can bind to DataSource.
double getRMS(const PlotterBase *plotter, const std::string &axis, int index=0) const
Returns the root mean square along the specified axis for DataRep indexed by index.
void setActiveDataRepIndex(PlotterBase *plotter, int index)
Sets the active DataRep index.
virtual void addDataRep(hippodraw::DataRep *rep)
Adds a DataRep object to the plotter.
virtual bool hasZeroRows()
Returns true if this DataRep has zero rows in its DataSource.
void stackDataRep(PlotterBase *, hippodraw::DataRep *) const
Adds the DataRep to the PlotterBase object by stacking it.
bool hasControlPoints(const PlotterBase *plotter) const
Returns true if value to color transform has control points.
The BinningProjector is an abstract class provides most of the functionality for a projector that doe...
hippodraw::XYTransform class interface
A singleton class that is the interface between GUI and the displays.
double getAverage(const PlotterBase *plotter, const std::string &axis, int index=0) const
Returns the average value.
virtual int activePlotIndex() const
Returns the index of the active plotter.
PointRepFactory class interface.
virtual DataRep * getDataRep(int index) const
Returns the specified DataRep or null pointer if it doesn't exits.
virtual AxisModelBase * getAxisModel(Axes::Type axis) const
Returns the AxisModelBase derived class for the specified axis.
PlotterBase * createDifferenceDisplay(PlotterBase *plotter)
Returns difference display.
hippodraw::TextRepFactory class interface
void setBinner(const PlotterBase *plotter, DataRep *rep, Axes::Type axis) const
Sets the binner on the DataRep.
void addTextViewToList(std::vector< const ViewBase * > &destination, const std::vector< const ViewBase * > &source)
Adds views from source to destination if they contain TextRep whose target is contained in destinatio...
void setRange(PlotterBase *plotter, Axes::Type axis, const Range &range)
Sets the Range on specified axis.
const std::vector< std::string > & getTextTypes() const
Returns the types of text displays.
void setAxisBindings(PlotterBase *plotter, const std::vector< std::string > &labels) const
Sets all the axis bindings, if any, otherwise does nothing.
void setLog(PlotterBase *plotter, const std::string &axis, bool flag)
Sets a log scale on or off for the specified axis for the plotter.
The abstract base class for a factory that creates objects closely related to the graphics subsystem ...
A DataSource class implemented with std::vector<double> to store the column data. ...
PlotterBase * createDisplay(const std::string &name)
Creates a display object.
void setIntervalEnabled(bool yes=true)
Sets interval counting to be enabled.
hippodraw::BinningProjector class interface
int getUnderflow(const PlotterBase *plotter, int index=0) const
Returns the number of underflow.
void setErrorDisplayed(const PlotterBase *, Axes::Type axis, bool state) const
Set the error display.
The base class for the value to the color transformation.
virtual void setAutoRanging(const std::string &axis, bool flag)
Sets the auto-ranging.
std::vector< std::string > m_null_vector
A empty vector of strings.
hippodraw::AxisModelLinear class interface
bool isDataValid(const PlotterBase *) const
Returns true only if all the data in a bound DataSource are valid.
virtual const BinToColor * getValueRep() const
Returns the value to color representation.
A derived class of DataRep which is a base class for displaying a function.
void setTransformAxis(PlotterBase *plotter, const std::string &x, const std::string &y)
Set both X and Y axis to log or linear, without resetting the bin width.
virtual TransformBase * getTransform() const
Returns the transform object used by the plotter.
A Factory singleton class for creating objects whose class derives from BinnerAxis.
A transform that transforms coordinates from one 2D coordinate system to another. ...
BinToUsrDefinedScale class interface.
virtual const DataSource * getNTuple() const
Returns the DataSource used by the projector.
virtual double getPosRange(Axes::Type axis) const
Returns the smallest positive number from the data.
hippodraw::DataRep * activeDataRep(const PlotterBase *plotter) const
Returns the active DataRep object for the DataRep objects contained in the plotter.
An exception class that is thrown when attempting an illegal operation on a PlotterBase object...
An xception class that is thrown when attempting to bind a DataRep to a NTuple with a column name tha...
const std::vector< std::string > & bindingOptions(const std::string &type)
Returns the axis binding options for a DataRep of type type.
Given a range, calculates a model for an axis with a linear scale.
static DisplayController * instance()
Returns the pointer to the singleton instance.
const std::string & name() const
Returns the name of the display.
virtual void expandIfNeeded(const std::vector< std::string > &labels) const
Expand the multidimension column if needed.
hippodraw::FunctionController class interface
hippodraw::TextDataRep class interface
bool removeValueTransform(const std::string &name)
Removes the value to color transform model.
const std::vector< std::string > & names() const
Returns the list of available prototype names.
intp size(numeric::array arr)
A singleton class is the interface between an application and the list of FunctionRep objects contain...
DataRep * createDataRep(const std::string &name)
Creates a new DataRep object of class name.
Type convert(const std::string &axis)
Converts from string representation ot Axes::Type representation.
bool isCompatible(const PlotterBase *plotter, const std::string &type) const
Returns true if adding a DataRep of type type to the PlotterBase @ plotter is compatible, otherwise returns false.
const std::vector< std::string > & axisBindings(const PlotterBase *plotter) const
Returns the axis bindings, if any, otherwise returns an empty vector.
The base class for the PlotterBase hierarchy.
void setPointRep(PlotterBase *plotter, const std::string &point_rep)
Sets the type of RepBase object to be used by the selected DataRep.
bool areDataSourcesSaved(const PlotterBase *)
Returns true if all the NTuple Objects used by the plotter are save to or read from a file...
hippodraw::DataRep * createTextDataRep(const std::string &type, const std::string &text=std::string())
Creates an object of a class derived from DataRep which is textual data representation of type type...
virtual int addColumn(const std::string &, const std::vector< double > &column)
Adds a column to the end of the ntuple and returns the index to the added column. ...
An exception class that is thrown when the factory fails to find the request class by its name...
ViewFactory class interface.
virtual int getNumDataReps() const
Returns the number of DataRep objects contained in the plot.
A PointRep class draws a symbol to represent the value.
const std::string & getDataSourceName(const PlotterBase *plotter, int index)
Returns the name of the DataSource for the DataRep contained in the plotter at index index...
The base class for data representations.
const std::vector< std::string > & getValueTransformTypes() const
Returns the types of value to color transforms available.
float size() const
Returns the size of the representation.
void setNTuple(PlotterBase *, const NTuple *) const
Sets the ntuple on the selected DataRep, if it has ntuple bindings, otherwise does nothing...
DataSource * getDataSource(const PlotterBase *plotter)
Returns the Datasource for the plotter's selected DataRep or the DataSource used by all the DataRep o...
const hippodraw::DataRep * getParentDataRep() const
Returns the target DataRep of its own TextDataRep object.
hippodraw::FitsController class interface.
void setAxisModel(PlotterBase *plotter, Axes::Type axis, const std::string &type)
Sets the axis model to type.
Type * prototype(const std::string &name) const
Returns a pointer to a prototype with name name.
The base class for the BinnerAxis hierarchy.
unsigned int getRepStyle(const PlotterBase *plotter) const
Returns the style of the point representation.
This Singleton class maintains a list of plotters.
This Singleton class maintains a list of DataRep objects.
virtual RepBase * representation() const =0
Returns the representation used by the plotter.
virtual void setOffset(const std::string &axis, int parm, bool dragging)
Sets the bin offset.
virtual bool isLog() const =0
Returns a boolean describing the type of the scale of the axis.
AxisModelLog class interface.
const std::vector< std::string > & getDisplayTypes() const
Returns the types of displays available.
void createNTuple(const PlotterBase *plotter)
Creates a NTuple from the plotter.
ProjectorBase * getProjector(const PlotterBase *display) const
Returns the currently selected projector in the plot.
A singleton class that is the interface between GUI and the DataRep.
void fixLogIfBinned(const PlotterBase *, hippodraw::DataRep *rep) const
Fixes the rep so it displays well on plotter.
PlotterBase * createTextPlotter(hippodraw::DataRep *datarep, const std::string &name, const std::string &text=std::string())
Creates a plotter object for the DataRep with text representation of type name.
TransformBase * yTransform() const
Returns the transform function on the Y axis.
TransformBase * createTransform(const std::string &name)
Creates a returns a new TransformBase object with given name.
virtual void setAxisBindings(const std::vector< std::string > &labels)
Sets the axis bindings, Sets, in the order of the binding options, the binding to the DataSource by l...
hippodraw::NTuple class interface.
const std::vector< std::string > & bindingOptions(const std::string &name)
Returns the binding options, if any, for the named DataRep.
hippodraw::FunctionRep class interface
The class derived from the BinToColor class.
void setIntervalEnabled(const PlotterBase *plotter, bool yes)
Sets the interval counting to yes on the NTuple of the active DataRep of the plotter.
void addObserver(Observer *)
Adds an Observer to the Observer list.
virtual void setBinnerOn(BinnerAxis *binner, hippodraw::Axes::Type axis)
Sets the bin edge calculator to binner on axis axis.
virtual void setAxisModel(AxisModelBase *, Axes::Type)=0
Sets the AxisModel on the specified axis.
virtual const std::vector< std::string > & getAxisBindings() const
Returns the current axis bindings.
PlotterException class interface.
void setText(const std::string &text)
Sets the text.
void saveValueCtrlPts(PlotterBase *plotter, const std::vector< double > &sv)
Save the updated control points of a BinToColor transform.
hippodraw::SymbolPointRep class interface
DataRepController class interface.
static TextRepFactory * instance()
Returns a pointer to the singleton instance.
bool hasNTupleBindings(const PlotterBase *plotter, int index)
Returns true if the DataRep contained by the plotter at index index has NTuple bindings.
void setAllIntervalEnabled(const PlotterBase *plotter, bool yes)
Sets the interval counting to yes of all the NTuple used by the plotter.
A Plotter class that draws text.
A transform that transforms coordinates from one coordinate system to another.
static PlotterFactory * instance()
Returns the pointer to the singleton instance.
void addValueTransform(const std::string &name, const std::vector< double > &ctrl_points)
Creates and adds to the factory a new value transform.
int getNumberOfEntries(const PlotterBase *plotter, int index=0) const
Returns the number of entries.
ViewBase * createTextView(const ViewFactory *factory, hippodraw::DataRep *rep, const std::string &name, const std::string &text=std::string())
Creates an object which is a derived class of ViewBase.
The AxisModelBase class maintains the Range and scaling of an axis.
static FunctionController * instance()
Returns the pointer to the singleton instance.
void removeObserver(Observer *)
Removes an Observer from the Observer list.
hippodraw::XyPlotter class interface
A factory for creation of objects whose class is derived from PointRepBase.
int getValueTransformIndex(PlotterBase *plotter)
Returns the index to list of value to color transform names of the plotter.
A singleton class that is the interface between GUI and the DataSource objects.