1#ifndef GAMR_NUCLEUS_DRAWLEVELSCHEME_HH
2#define GAMR_NUCLEUS_DRAWLEVELSCHEME_HH
19 class State :
public TNamed,
public TAttLine {
41 State(std::string name,
Scheme *scheme,
double energy,
double left,
double right, std::string leftlabel, std::string rightlabel, EColor color=kBlack) :
58 void AddTransition(
const char* name_fin,
double width,
double start,
double stop,
double labelpos = 0.5, EColor color=kBlack);
61 void Paint(Option_t *option=
"");
93 { SetLineColor(color); SetFillColor(color);
fLabel =
new TText();
fLabelBox =
new TBox(); SetPolyLine(7); }
96 void Paint(Option_t *option =
"");
99 void Draw(Option_t *option =
"") { TPolyLine::Draw(option); }
117 int px1, px2, px1old, px2old;
118 int py1, py2, py1old, py2old;
119 double XtoAbsPixel(
double x);
120 double YtoAbsPixel(
double y);
121 double AbsPixeltoX(
double xpix);
122 double AbsPixeltoY(
double ypix);
141 void AddState(std::string name,
double energy,
double left,
double right, std::string leftlab, std::string rightlab, EColor color=kBlack) {
State state(name,
this, energy, left, right, leftlab, rightlab, color); state.
textsize =
textsize;
fStates[name]=state; }
142 void AddTransition(std::string initState, std::string finState,
double width,
double start,
double stop,
double labelpos=0.5, EColor color=kBlack) {
159 void Paint(Option_t *option=
"");
void py(TVirtualPad *canvas)
void px(TVirtualPad *canvas)
void SetTextSize(double size)
std::map< std::string, State > fStates
void Paint(Option_t *option="")
void AddState(std::string name, double energy, double left, double right, std::string leftlab, std::string rightlab, EColor color=kBlack)
void SetDrawRange(double xlow, double xhigh, double eLow, double eHigh)
std::vector< Transition > fTransitions
void ReadScheme(std::string filename)
void AddTransition(std::string initState, std::string finState, double width, double start, double stop, double labelpos=0.5, EColor color=kBlack)
void WriteScheme(std::string filename)
void AddTransition(const char *name_fin, double width, double start, double stop, double labelpos=0.5, EColor color=kBlack)
void Paint(Option_t *option="")
bool operator==(const State &rhs) const
bool operator<(const State &rhs) const
void SetLabels(const char *leftlab, const char *rightlab)
void ExecuteEvent(Int_t event, Int_t px, Int_t py)
void SetLeftRight(double left, double right)
void SetWidth(double width)
void SetExtension(double left, double right)
Int_t DistancetoPrimitive(Int_t px, Int_t py)
State(std::string name, Scheme *scheme, double energy, double left, double right, std::string leftlabel, std::string rightlabel, EColor color=kBlack)
void Draw(Option_t *option="")
void SetStartStop(double start, double stop)
Int_t DistancetoPrimitive(Int_t px, Int_t py)
Transition(Scheme *scheme, State *initial, State *final, double width, double start, double stop, double labelpos, EColor color)
void ExecuteEvent(Int_t event, Int_t px, Int_t py)
void Paint(Option_t *option="")