14 #include "msdevstudio/MSconfig.h"
32 using std::runtime_error;
36 using namespace hippodraw;
58 const vector< string > &
67 const vector < string > &
82 const std::vector < std::string > & bindings )
const
84 if ( ntuple == 0 )
return false;
87 vector < string > ::const_iterator first = bindings.begin ();
88 while ( first != bindings.end() ) {
89 const string & label = *first++;
90 if ( label ==
"nil" )
continue;
91 ntuple -> throwIfInvalidLabel ( label );
97 const vector < string > &
103 return factory ->
names ();
113 rep = factory -> create ( type );
116 const string what = e.
what ();
120 projector -> addObserver ( rep );
129 const std::vector < std::string > & bindings )
const
148 const std::vector < std::string > & bindings )
const
158 const vector < const TupleCut * > & cuts = ntProjector -> getCutList ();
159 unsigned int size = cuts.size ();
160 for (
unsigned int i = 0;
i <
size;
i++ ) {
162 const string & label = tc -> getLabel ();
163 unsigned int index = ntProjector -> indexOf ( label );
165 cut -> setColumn ( index );
177 assert ( projector != 0 );
179 DataSource * source = projector -> getNTuple ();
180 source -> removeObserver ( rep );
182 const vector < string > & bindings = projector -> getAxisBindings ();
187 catch (
const runtime_error & e ) {
virtual void setNTuple(const DataSource *source)
Changes the DataSource used for the projections to source.
Type * create(const std::string &name)
Creates a new object from a prototype named name.
Type * prototype(const std::string &name) const
Returns a pointer to a prototype with name name.
~DataRepController()
The destructor.
DataRepController()
A default constructor for avoiding creation except by itself or with derived classes.
static DataRepFactory * instance()
Returns the pointer to the singleton instance.
virtual void setAxisBindings(const std::vector< std::string > &bindings)
Sets the axis bindings.
virtual void expandIfNeeded(const std::vector< std::string > &labels) const
Expand the multidimension column if needed.
const std::vector< std::string > & bindingOptions(const std::string &name)
Returns the binding options, if any, for the named DataRep.
char const * what() const
The error message that can be retreived.
static DataRepController * s_instance
The pointer to the singleton object.
An NTupleProjector is a projector that projects data from an DataSource object.
The class expresses a cut on a DataSource, i.e.
DataRep * createDataRep(const std::string &name)
Creates a new DataRep object of class name.
hippodraw::NTuple class interface.
hippodraw::FunctionRep class interface
PyArray_TYPES type(numeric::array arr)
The base class for data representations.
DataRepController class interface.
This Singleton class maintains a list of DataRep objects.
intp size(numeric::array arr)
bool checkBindings(const DataSource *tuple, const std::vector< std::string > &bindings) const
Returns true if all the the string objects in the vector bindings are valid labels for the columns in...
A singleton class that is the interface between GUI and the DataRep.
The base class for the Projector hierarchy.
static DataRepController * instance()
Returns the pointer to the singleton instance.
hippodraw::TupleCut class interface
An xception class that is thrown when attempting to bind a DataRep to a NTuple with a column name tha...
void setAxisBindings(DataRep *rep, const DataSource *ntuple, const std::vector< std::string > &bindings) const
Sets the axis binding of the DataRep object.
virtual const std::vector< std::string > & bindingOptions() const
Returns a vector of strings describing the binding options.
An exception class that is thrown when the factory fails to find the request class by its name...
const std::vector< std::string > & names() const
Returns the names of the types of DataRep objects available.
void addObserver(Observer *)
Adds an Observer to the Observer list.
virtual ProjectorBase * getProjector() const
Returns the Projector object controlling the data.
hippodraw::NTupleProjector class interface
void changeDataSource(DataRep *rep, const DataSource *tuple)
Changes the DataSource.
std::vector< std::string > m_null_vector
A empty vector of strings.
hippodraw::PlotterBase class interface.
Base class for DataSource.