00001 00012 // for truncation warning 00013 #ifdef _MSC_VER 00014 #include "msdevstudio/MSconfig.h" 00015 #endif 00016 00017 #include "Cut1DPlotter.h" 00018 00019 #include "datareps/DataRep.h" 00020 #include "datasrcs/TupleCut.h" 00021 00022 #include "reps/CutRangeRep.h" 00023 #include <cassert> 00024 00025 using std::vector; 00026 00027 using namespace hippodraw; 00028 00029 Cut1DPlotter::Cut1DPlotter ( ) 00030 : CutPlotter ( "Cut1DPlotter" ) 00031 { 00032 } 00033 00034 Cut1DPlotter::Cut1DPlotter ( const Cut1DPlotter & plotter ) 00035 : CutPlotter ( plotter ) 00036 { 00037 } 00038 00039 Cut1DPlotter::~Cut1DPlotter () 00040 { 00041 } 00042 00043 PlotterBase * Cut1DPlotter::clone() 00044 { 00045 return new Cut1DPlotter ( *this ); 00046 } 00047 00048 void 00049 Cut1DPlotter:: 00050 addTupleCut ( DataRep * rep ) 00051 { 00052 m_datarep=rep; 00053 m_datarep -> addCut ( TupleCut () ); 00054 } 00055 00056 00057 void 00058 Cut1DPlotter:: 00059 addDataRep ( DataRep * rep ) 00060 { 00061 XyPlotter::addDataRep ( rep ); 00062 } 00063 00064 void 00065 Cut1DPlotter:: 00066 setAxisBinding ( const std::vector < std::string > & bindings ) 00067 { 00068 assert ( bindings.size () == 1 ); 00069 00070 CutPlotter::setAxisBinding ( bindings ); 00071 } 00072 00073 void Cut1DPlotter::setCutRangeFull ( ) 00074 { 00075 const Range & range = getRange ( Axes::X, false ); 00076 m_datarep -> setCutRangeAt ( range, 0 ); 00077 00078 updateTargets (); 00079 } 00080 00081 void 00082 Cut1DPlotter:: 00083 toggleInverted () 00084 { 00085 m_datarep -> toggleInverted ( 0 ); 00086 00087 updateTargets (); 00088 } 00089 00090 const std::string & 00091 Cut1DPlotter:: 00092 getCutLabel () const 00093 { 00094 const vector < TupleCut > & cuts = m_datarep -> getCuts (); 00095 const TupleCut & cut = cuts[0]; // so Doxygen sees it. 00096 00097 return cut.getLabel (); 00098 }