27 TPadStock::TPadStock(
const char* name,
const char* title, Double_t x1, Double_t y1, Double_t x2, Double_t y2, Color_t color, Short_t bordersize, Short_t bordermode) :
28 TPad ( name, title, x1, y1, x2, y2, color, bordersize, bordermode )
31 std::cout <<
"Constructor TPadStock" << std::endl;
32 std::cout <<
"this " <<
this << std::endl;
39 std::cout <<
"TPadStock::GetTHStock" << std::endl;
45 TIter next( GetListOfPrimitives() );
46 while ( (obj = next()) ) {
47 if ( obj->InheritsFrom(
"THStock") ) {
49 return dynamic_cast<THStock*
>(obj);
52 std::cout <<
"\t\nTPadStock::GetTHStock NOT FOUND !\n" << std::endl;
59 std::cout <<
"TPadStock AddToTHStock" << std::endl;
64 std::cout <<
"\nERROR TH1 not found in TPadStock::AddToTHStock\n" << std::endl;
66 ths->
Add( obj_stock );
77 Int_t pxl, pyl, pxt, pyt;
78 Int_t px1 = gPad->XtoAbsPixel(fX1);
79 Int_t py1 = gPad->YtoAbsPixel(fY1);
80 Int_t px2 = gPad->XtoAbsPixel(fX2);
81 Int_t py2 = gPad->YtoAbsPixel(fY2);
82 if (px1 < px2) {pxl = px1; pxt = px2;}
83 else {pxl = px2; pxt = px1;}
84 if (py1 < py2) {pyl = py1; pyt = py2;}
85 else {pyl = py2; pyt = py1;}
99 Int_t dxl = TMath::Abs(px - pxl);
100 if (py < pyl) dxl += pyl - py;
if (py > pyt) dxl += py - pyt;
101 Int_t dxt = TMath::Abs(px - pxt);
102 if (py < pyl) dxt += pyl - py;
if (py > pyt) dxt += py - pyt;
103 Int_t dyl = TMath::Abs(py - pyl);
104 if (px < pxl) dyl += pxl - px;
if (px > pxt) dyl += px - pxt;
105 Int_t dyt = TMath::Abs(py - pyt);
106 if (px < pxl) dyt += pxl - px;
if (px > pxt) dyt += px - pxt;
108 Int_t distance = dxl;
109 if (dxt < distance) distance = dxt;
110 if (dyl < distance) distance = dyl;
111 if (dyt < distance) distance = dyt;
113 #ifdef DEBUG_OBJSTOCK
114 std::cout <<
"TPadStock::DistancetoPrimitive will return " << distance - Int_t(0.5*fLineWidth) << std::endl;
116 return distance - Int_t(0.5*fLineWidth);
126 #ifdef DEBUG_OBJSTOCK
127 std::cout <<
"Entry TPadStock::PaintPadFrameStock" << std::endl;
134 if (!fPrimitives) fPrimitives =
new TList;
135 TList *glist = GetListOfPrimitives();
136 TFrame *frame = GetFrame();
141 if (!glist->FindObject(fFrame)) {
144 #ifdef DEBUG_OBJSTOCK
145 std::cout <<
"TPadStock::PaintPadFrameStock fFrame not found set kMustCleanup ?" << std::endl;
147 fFrame->SetBit(kMustCleanup);
149 #ifdef DEBUG_OBJSTOCK
151 std::cout <<
"TPadStock::PaintPadFrameStock fFrame found " << std::endl;
155 if (gROOT->GetForceStyle()) frame->UseCurrentStyle();
163 #ifdef DEBUG_OBJSTOCK
164 std::cout <<
"Entry TPadStock::ExecuteEvent px, py " << px <<
" " << py << std::endl;
169 #ifdef DEBUG_OBJSTOCK
170 std::cout <<
"return directly EditorObjStock is None " << std::endl;
176 #ifdef DEBUG_OBJSTOCK
177 std::cout <<
"MakePrimitve ObjectStock" << std::endl;
187 #ifdef DEBUG_OBJSTOCK
188 std::cout <<
"kButtonDown " << std::endl;
198 std::cout <<
"After SetParent " << obj->
GetParent()->GetName() << std::endl;
201 std::cout <<
"CreateObjectLine with anchor" << std::endl;
221 std::cout <<
"GetAnchor for final stage " << std::endl;
240 #ifdef DEBUG_OBJSTOCK
241 std::cout <<
" event not deal by TPadExecuteEvent " << std::endl;
Derive from TH1 will draw the graph.
void PaintPadFrameStock(Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax)
virtual void SetParent(THStock *thstock)
void AnchorToIndicator(const int &px, const int &py, ObjectLine *obj_line, FactoryObjectStock::EStageDraw kDraw)
set px, py to the closest indicator point
virtual void Add(ObjectLine *obj_stock)
call by Factory, specific to drawable line
Seems present because of ExecuteEvent not overloaded by CanvasStock CanvasStock contains Pad...
Regroup sub-hierarchy related to the LineObject :
static ObjectLine * CreateDrawableObjectLine(int stage_draw, double valueX, double valueY, TypeLine mode_obj)
create specifically ObjectLine
Used for free drawing of support/tendance Add a general line description with coeef_d and origin : y ...
THStock * GetTHStock() const
Loop over the ListOfPrimitives of TPad.
virtual void AddToTHStock(ObjectLine *)
Add an ObjectStock to THStock.
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a box.
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Called if TPadStock::DistancetoPrimitive return the smallest distance Called only if not candle or an...
virtual THStock * GetParent() const
public access to parent THStock