本文整理汇总了C++中TVirtualPad::GetTitle方法的典型用法代码示例。如果您正苦于以下问题:C++ TVirtualPad::GetTitle方法的具体用法?C++ TVirtualPad::GetTitle怎么用?C++ TVirtualPad::GetTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TVirtualPad
的用法示例。
在下文中一共展示了TVirtualPad::GetTitle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: splithist
void splithist(double ratio=0.2){
TVirtualPad* pmain = TVirtualPad::Pad();
double h = 1. - pmain->GetTopMargin() - pmain->GetBottomMargin();
double xlow = 0.; //gStyle->GetPadLeftMargin();
double xhigh = 1.; // - gStyle->GetPadRightMargin();
double ytop = 1.; //- gStyle->GetPadTopMargin();
double ybot = 0.; //gStyle->GetPadBottomMargin();
double ymid = pmain->GetBottomMargin() + ratio * h; //ybot + ratio * (ytop-ybot);
double yp1bot = ymid;
double yp2top = ymid;
TPad* p1 = new TPad(TString(pmain->GetName()) + "_1", pmain->GetTitle(),
xlow, yp1bot, xhigh, ytop);
p1->SetNumber(1);
TPad* p2 = new TPad(TString(pmain->GetName()) + "_2", pmain->GetTitle(),
xlow, ybot, xhigh, yp2top);
p2->SetNumber(2);
p1->SetFillStyle(4000);
p2->SetFillStyle(4000);
double p1h = ytop - yp1bot;
double p2h = yp2top - ybot;
/*
p1->SetTopMargin(pmain->GetTopMargin()/p1h);
p1->SetBottomMargin((ymid-yp1bot)/p1h);
p1->SetLeftMargin(pmain->GetLeftMargin());
p1->SetRightMargin(pmain->GetRightMargin());
p2->SetTopMargin((ymid-yp2top)/p2h);
p2->SetBottomMargin(pmain->GetBottomMargin()/p2h);
p2->SetLeftMargin(pmain->GetLeftMargin());
p2->SetRightMargin(pmain->GetRightMargin());
*/
p1->SetTopMargin(0.11);
p1->SetBottomMargin(0.);
p1->SetRightMargin(0.02);
p2->SetTopMargin(0.);
p2->SetBottomMargin(0.3);
p2->SetRightMargin(0.02);
p2->Draw();
p1->Draw();
pmain->Modified();
p1->cd();
}
示例2: MakeFourView
//_______________________________________________________________________________________
void MakeFourView(TVirtualPad *pad=0)
{
// Creates 4 pads view of the pad (or qPad)
// ------------------------------
// | | |
// | | |
// | | |
// | Front | Top |
// | view | view |
// | | |
// | | |
// | | |
// ---------------+-------------
// | | |
// | | |
// | | |
// | Side | Spacial |
// | view | view |
// | | |
// | | |
// | | |
// ------------------------------
// begin_html <P ALIGN=CENTER> <IMG SRC="gif/FourStarView.gif" ></P> end_html
//
TVirtualPad *thisPad = pad;
if (!thisPad) thisPad = qPad();
TView *view = 0;
TList *thisPrimitives = 0;
if (thisPad && (thisPrimitives = thisPad->GetListOfPrimitives()) && (view = thisPad->GetView()) )
{
Double_t min[3],max[3];
view->GetRange(min,max);
Int_t system = view->GetSystem();
TCanvas *c = new TCanvas(" 4 views", thisPad->GetTitle(),600,600);
c->Divide(2,2);
TIter *next= new TIter(thisPrimitives);
for (int i =1; i <= 4; i++) {
c->cd(i);
TList *newPrimitives = qPad()->GetListOfPrimitives();
TObject *obj = 0;
while (obj = next->Next()) newPrimitives->Add(obj);
TView *newView = new TView(system);
newView->SetRange(min,max);
next->Reset();
}
delete next;
// set separate view;
// Fron view
Int_t j = 1;
c->cd(j++); FrontView();
c->cd(j++); TopView();
c->cd(j++); SideView();
c->cd(j++); RotateView(-30.0,60.0,0);
c->Modified();
c->Update();
}
}