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 ();
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();
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] ) {
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 )
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 );
virtual RepBase * representation() const =0
Returns the representation used by the plotter.
PlotterBase * createPlotter(const hippodraw::DataRep *rep) const
Returns a newly created PlotterBase object.
virtual bool isAxisBinned(const std::string &axis) const
Returns true if specified axis is binned.
Given a range, calculates a model for an axis with a log scale.
void addDataRep(PlotterBase *, hippodraw::DataRep *) const
Adds the DataRep to the PlotterBase object by including it.
void setRepSize(double size)
Sets the size of the representation.
A Plotter class that plots points in 2 dimensions and option a third dimension in color...
void setAxisModelWithoutSetBin(PlotterBase *plotter, Axes::Type axis, const std::string &type)
set the axis to log or linear, without reseting the bin width.
static FitsController * instance()
Returns the singleton instance of the FitsController.
virtual void setNTuple(const DataSource *source)
Changes the DataSource used for the projections to source.
virtual ViewBase * createView(PlotterBase *plotter) const =0
Creates a view for the plotter.
int getUniqueNonFunctionIndex(const PlotterBase *plotter) const
Returns the index to an unique DataRep object that is not a FunctionRep.
void setValueCtrlPts(PlotterBase *plotter, const std::vector< double > &sv)
Sets the control points for the value to color transform model.
The BinningProjector is an abstract class provides most of the functionality for a projector that doe...
Type * create(const std::string &name)
Creates a new object from a prototype named name.
void remove(PlotterBase *)
Deletes a PlotterBase object.
void setRepSize(PlotterBase *plotter, float size)
Sets the size of the representation.
A singleton class that is the interface between GUI and the displays.
virtual const DataSource * getNTuple() const
Returns the DataSource used by the projector.
double high() const
Returns the maximum of the range object.
hippodraw::SymbolPointRep class interface
virtual void notifyObservers() const
Notifies Observer objects of a change.
const std::vector< double > & getValueCtrlPts(const PlotterBase *plotter)
Returns the control points of the value to color transform model.
~DisplayController()
The destructor.
void setBinWidth(PlotterBase *plotter, Axes::Type axis, double width)
Sets the bin width parameter.
LineDataRep class interface.
hippodraw::TextRepFactory class interface
int activeDataRepIndex(const PlotterBase *plotter) const
Returns the active DataRep index for the DataRep objects contained in the plotter.
virtual const BinToColor * getValueRep() const
Returns the value to color representation.
void setValueTransform(PlotterBase *plotter, const std::string &name)
Sets the value to color transform model.
TransformBase * yTransform() const
Returns the transform function on the Y axis.
A transform that transforms coordinates from one coordinate system to another.
Type * prototype(const std::string &name) const
Returns a pointer to a prototype with name name.
The base class for the value to the color transformation.
static BinToColorFactory * instance()
Returns a pointer to the singleton instance.
hippodraw::AxisModelLinear class interface
NTuple * createNTupleDiff(PlotterBase *plotter)
void stackDataRep(PlotterBase *, hippodraw::DataRep *) const
Adds the DataRep to the PlotterBase object by stacking it.
static DataRepFactory * instance()
Returns the pointer to the singleton instance.
static FunctionController * 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.
A Factory singleton class for creating objects whose class derives from BinnerAxis.
bool isAxisBinned(PlotterBase *display, const std::string &axis)
Tests if specified axis is binned.
hippodraw::XYTransform class interface
const std::string & getType(const PlotterBase *plotter, int index) const
Returns the type of DataRep contained in the plotter at index index.
virtual int activePlotIndex() const
Returns the index of the active plotter.
const std::vector< std::string > & names() const
Returns the list of available prototype names.
void setParentDataRep(hippodraw::DataRep *)
Sets the target DataRep of its own TextDataRep object.
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...
const std::vector< std::string > & bindingOptions(const std::string &name)
Returns the binding options, if any, for the named DataRep.
A transform that transforms the X and Y coordinates independently.
PointRepFactory class interface.
Given a range, calculates a model for an axis with a linear scale.
DisplayController()
A default constructor for avoiding creation except by itself or with derived classes.
TextPlotter class interface.
void setLog(PlotterBase *plotter, const std::string &axis, bool flag)
Sets a log scale on or off for the specified axis for the plotter.
virtual void setOffset(const std::string &axis, int parm, bool dragging)
Sets the bin offset.
virtual void setAxisModel(AxisModelBase *, Axes::Type)=0
Sets the AxisModel on the specified axis.
static PointRepFactory * instance()
Returns a pointer to the singleton instance.
hippodraw::FunctionController class interface
hippodraw::TextDataRep class interface
bool hasLineRep(const PlotterBase *plotter) const
Returns true if active DataRep uses LinePointRep, otherwise returns false.
hippodraw::BinningProjector class interface
A singleton class is the interface between an application and the list of FunctionRep objects contain...
std::vector< std::string > m_null_vector
A empty vector of strings.
bool hasSymbolRep(const PlotterBase *plotter) const
Returns true if active DataRep uses SymbolPointRep, otherwise returns false.
static PlotterFactory * instance()
Returns the pointer to the singleton instance.
An NTupleProjector is a projector that projects data from an DataSource object.
ViewFactory class interface.
virtual unsigned int rows() const
Returns the number of rows.
A derived class of DataRep which is a base class for displaying a function.
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.
LineDataRep * addLineRep(PlotterBase *, const std::string &axis, double value)
Adds a LineDataRep to the Plotter object.
BinToUsrDefinedScale class interface.
int getOverflow(const PlotterBase *plotter, int index=0) const
Returns the number of overflow.
bool hasControlPoints(const PlotterBase *plotter) const
Returns true if value to color transform has control points.
TransformBase * xTransform() const
Returns the transform function on the X axis.
static DisplayController * s_instance
The pointer to the singleton object.
double getAverage(const PlotterBase *plotter, const std::string &axis, int index=0) const
Returns the average value.
TransformBase * createTransform(const std::string &name)
Creates a returns a new TransformBase object with given name.
DataRep * createDataRep(const std::string &name)
Creates a new DataRep object of class name.
PlotterBase * createDifferenceDisplay(PlotterBase *plotter)
Returns difference display.
virtual const Range & setRange(const Range &, bool hold_width=true)=0
Sets the range.
hippodraw::DataRep * getUniqueWithNTupleBindings(const PlotterBase *plotter)
Returns the unique DataRep.
virtual ProjectorBase * getProjector(int i) const
Returns the projector at index i.
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...
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.
void setPointRep(PlotterBase *plotter, const std::string &point_rep)
Sets the type of RepBase object to be used by the selected DataRep.
AxisModelLog class interface.
void setActiveDataRepIndex(PlotterBase *plotter, int index)
Sets the active DataRep index.
hippodraw::NTuple class interface.
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...
hippodraw::FunctionRep class interface
The base class for the PlotterBase hierarchy.
virtual ProjectorBase * activeProjector() const
Returns the active projector.
static TransformFactory * instance()
Returns a pointer to the singleton instance.
virtual int getNumDataReps() const
Returns the number of DataRep objects contained in the plot.
float pointSize(const PlotterBase *) const
Returns the size of the representation.
PlotterBase * getPlotter() const
Returns the plotter used by this view.
A PointRep class draws a symbol to represent the value.
void removeObserver(Observer *)
Removes an Observer from the Observer list.
bool isDataValid(const PlotterBase *) const
Returns true only if all the data in a bound DataSource are valid.
PyArray_TYPES type(numeric::array arr)
The class derived from the BinToColor class.
The base class for data representations.
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...
virtual const std::vector< std::string > & getLabels() const
Returns the list of available labels.
virtual void checkAxisScaling()
Check if Axis needs to be scaled or not.
static TextRepFactory * instance()
Returns a pointer to the singleton instance.
A factory for textual representations.
virtual void addDataRep(DataRep *rep)
Adds a DataRep object to the plotter.
hippodraw::FitsController class interface.
DataRepController 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 BinnerAxis hierarchy.
This Singleton class maintains a list of plotters.
This Singleton class maintains a list of DataRep objects.
intp size(numeric::array arr)
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.
A singleton class that is the interface between GUI and the DataRep.
The AxisModelBase class maintains the Range and scaling of an axis.
virtual bool hasNTupleBindings() const
Returns true if the DataRep's projector can bind to DataSource.
void setIntervalEnabled(const PlotterBase *plotter, bool yes)
Sets the interval counting to yes on the NTuple of the active DataRep of the plotter.
virtual void setBinnerOn(BinnerAxis *binner, hippodraw::Axes::Type axis)
Sets the bin edge calculator to binner on axis axis.
hippodraw::DataRep * activeDataRep(const PlotterBase *plotter) const
Returns the active DataRep object for the DataRep objects contained in the plotter.
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. ...
const std::vector< std::string > & bindingOptions(const std::string &type)
Returns the axis binding options for a DataRep of type type.
A factory for creation of objects whose class is derived from PointRepBase.
A singleton class that is the interface between GUI and the DataSource objects.
virtual bool isLog() const =0
Returns a boolean describing the type of the scale of the axis.
static DisplayController * instance()
Returns the pointer to the singleton instance.
TransformBase * zTransform() const
Returns the transform function on the Z axis.
const std::vector< std::string > & getValueTransformTypes() const
Returns the types of value to color transforms available.
Part of an implementation of the Observable Observer pattern based on the example implementation in t...
PlotterException class interface.
void setNTuple(PlotterBase *, const NTuple *) const
Sets the ntuple on the selected DataRep, if it has ntuple bindings, otherwise does nothing...
virtual DataRep * getDataRep(int index) const
Returns the specified DataRep or null pointer if it doesn't exits.
bool hasNTupleBindings(const PlotterBase *plotter, int index)
Returns true if the DataRep contained by the plotter at index index has NTuple bindings.
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. ...
hippodraw::TextRepBase class interface
The base class for the Projector hierarchy.
static DataRepController * instance()
Returns the pointer to the singleton instance.
hippodraw::BinToColorScaleMovingBrkPt class interface
void setBinner(const PlotterBase *plotter, DataRep *rep, Axes::Type axis) const
Sets the binner on the DataRep.
const std::string & name() const
Returns the name of the Transform.
The abstract base class for views.
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.
A Plotter class that draws text.
void setRangePos(double)
The function which changes the pos member of m_range.
PlotterBase * createDisplay(const std::string &name)
Creates a display object.
unsigned int getRepStyle(const PlotterBase *plotter) const
Returns the style of the point representation.
A Controller class for FITS files.
const std::vector< std::string > & getDisplayTypes() const
Returns the types of displays available.
void createNTuple(const PlotterBase *plotter)
Creates a NTuple from the plotter.
virtual void setRange(Axes::Type axis, const Range &range, bool scaled=false, bool adjust_width=true)
Sets the range on the specified axis.
static BinnerAxisFactory * instance()
Returns a pointer to the singleton instance.
hippodraw::ColumnPointRep class interface
A transform that transforms coordinates from one 2D coordinate system to another. ...
DataSource * getDataSource(const PlotterBase *plotter)
Returns the Datasource for the plotter's selected DataRep or the DataSource used by all the DataRep o...
hippodraw::XyPlotter class interface
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.
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...
A factory for creation of objects whose class is derived from BinToColor.
void setAxisModel(PlotterBase *plotter, Axes::Type axis, const std::string &type)
Sets the axis model to type.
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.
virtual bool hasAxis(Axes::Type axis) const
Returns true if the plotter has an axis of specified type.
void setTransform(PlotterBase *plotter, const std::string &name)
Creates and sets a new transform for the display.
virtual const std::vector< std::string > & getAxisBindings() const
Returns the current axis bindings.
StripChart class interface.
Expresses a range of values.
virtual void setParentPlotter(PlotterBase *plotter)
Sets the parent plotter.
ProjectorBase * getProjector(const PlotterBase *display) const
Returns the currently selected projector in the plot.
void fixLogIfBinned(const PlotterBase *, hippodraw::DataRep *rep) const
Fixes the rep so it displays well on plotter.
A PointRep class that draws a column to represent the value.
hippodraw::NTupleController class interface
bool removeValueTransform(const std::string &name)
Removes the value to color transform model.
virtual AxisModelBase * getAxisModel(Axes::Type axis) const
Returns the AxisModelBase derived class for the specified axis.
const hippodraw::DataRep * getParentDataRep() const
Returns the target DataRep of its own TextDataRep object.
Type convert(const std::string &axis)
Converts from string representation ot Axes::Type representation.
A derived class of DataRep which displays a value as a line along the X or Y axis.
void setIntervalCount(int number)
Sets the interval count.
An exception class that is thrown when the factory fails to find the request class by its name...
void removeTextObservers(const std::vector< const ViewBase * > &views)
Removes TextRep Observer objects, if any, from its target.
DataSourceController class interface.
NTupleProjector * getBindingProjector(const PlotterBase *) const
Returns projector that supports binding, if display has one, otherwise returns null pointer...
BinToMovingBrkPt class interface.
void addValueTransform(const std::string &name, const std::vector< double > &ctrl_points)
Creates and adds to the factory a new value transform.
A PointRep class that draws a column to represent the value.
bool areDataSourcesSaved(const PlotterBase *)
Returns true if all the NTuple Objects used by the plotter are save to or read from a file...
int getNumberOfEntries(const PlotterBase *plotter, int index=0) const
Returns the number of entries.
void addObserver(Observer *)
Adds an Observer to the Observer list.
The singleton Factory class for creating objects whose class is derived from TransformBase.
hippodraw::ViewBase class interface
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...
virtual void setAutoRanging(const std::string &axis, bool flag)
Sets the auto-ranging.
virtual ProjectorBase * getProjector() const
Returns the Projector object controlling the data.
Displays data in textual representation.
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.
const std::string & name() const
Returns the name of the value to color transform.
DisplayController class interface declaration.
float size() const
Returns the size of the representation.
hippodraw::NTupleProjector class interface
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.
int getValueTransformIndex(PlotterBase *plotter)
Returns the index to list of value to color transform names of the plotter.
hippodraw::BinnerAxis class interface
virtual void setTransform(TransformBase *)
Sets the transform object.
void setAllIntervalEnabled(const PlotterBase *plotter, bool yes)
Sets the interval counting to yes of all the NTuple used by the plotter.
The base class for the point representation hierarchy.
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.
hippodraw::LinePointRep class interface
bool isUserDefinedValueTransform(const PlotterBase *plotter) const
Returns true if value to color transform is user defined.
virtual double getPosRange(Axes::Type axis) const
Returns the smallest positive number from the data.
BinToColorFactory class interface.
static DataSourceController * instance()
Returns the pointer to the singleton instance.
Base class for DataSource.
void setIntervalCount(const PlotterBase *plotter, unsigned int count)
Sets the interval count on the the NTuple of the active DataRep of the plotter.
void setIntervalEnabled(bool yes=true)
Sets interval counting to be enabled.
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.
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...