• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ TProfile类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中TProfile的典型用法代码示例。如果您正苦于以下问题:C++ TProfile类的具体用法?C++ TProfile怎么用?C++ TProfile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了TProfile类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: Plot2DHisto

void Plot2DHisto(TH2D* plothist, char xTitle[200], char yTitle[200], char savename[200], char tex[200]) {

    TGaxis::SetMaxDigits(3);

    TCanvas *c1 = new TCanvas("", "", 1200, 1000);
    gStyle->SetPalette(1);
    gStyle->SetOptStat(0);
    gPad->SetFillColor(kWhite);
    gPad->SetLeftMargin(0.15);
    gPad->SetRightMargin(0.2);
    gPad->SetTopMargin(0.1);

    double yOffset=1.4;
    plothist->GetYaxis()->SetTitleOffset(yOffset);
    plothist->SetStats(0);
    plothist->SetTitle(0);
    plothist->GetYaxis()->SetTitle(yTitle);
    plothist->GetXaxis()->SetTitle(xTitle);
    plothist->SetMinimum(0.);

    plothist->Draw("colz");

    double left=0.25, top=0.935, textSize=0.04;
    TLatex *latex=new TLatex();
    latex->SetTextFont(42);
    latex->SetNDC(kTRUE);
    latex->SetTextSize(textSize);
    latex->DrawLatex(left,top,tex);



    char linlog_savename[200];
    c1->SetLogz(false);
    sprintf(linlog_savename,"%s_lin.pdf",savename);
    c1->SaveAs(linlog_savename);
    c1->SetLogz(true);
    sprintf(linlog_savename,"%s_log.pdf",savename);
    c1->SaveAs(linlog_savename);

    TProfile* profileX = plothist->ProfileX("", 1, -1, "so");
    TProfile* profileY = plothist->ProfileY("", 1, -1, "so");

    profileX->Draw("same");

    sprintf(linlog_savename,"%s_log_AddProfile.pdf",savename);
    c1->SaveAs(linlog_savename);

    profileX->Draw();
    latex->DrawLatex(left,top,tex);
    sprintf(linlog_savename,"%s_log_ProfileX.pdf",savename);
    c1->SaveAs(linlog_savename);
    profileY->Draw();
    latex->DrawLatex(left,top,tex);
    sprintf(linlog_savename,"%s_log_ProfileY.pdf",savename);
    c1->SaveAs(linlog_savename);

    delete c1;
    delete latex;

}
开发者ID:knuenz,项目名称:ChicPol,代码行数:60,代码来源:CtauErrModel.C


示例2: rotate2DN

void rotate2DN(const char* filename,int detNum){


  TFile *f = new TFile(filename);

  TCanvas* cnew= new TCanvas("cnew","",800.,500.);
  cnew->cd();
   

  stringstream sss;
  sss<<"Transposed-"<<filename;
  TFile f1(sss.str().c_str(),"RECREATE");

  for (int i=0;i<detNum;i++){
    stringstream orig ;
    orig<<"hNc"<<i ;
    TH2D* h1=(TH2D*)f->Get(orig.str().c_str());
    
    string gname = h1->GetTitle();
    stringstream hname ;
    hname<<"hN"<<i;
    TH2D* Hnew = new TH2D(hname.str().c_str(),gname.c_str(),1700.,0.,1700.,8000.,0.,8000.);
    for (int x=0;x<8000;x++){
      for (int y=0;y<1600;y++){
 	int bin = h1->GetBinContent(x,y);
	Hnew->Fill(y,x,bin);
      }
    }
    cout<<"Histogram Number "<<i<<" transpose completed"<<endl; 
    cnew->cd();
    
    Hnew->SetMinimum(7);
    Hnew->GetYaxis()->SetRangeUser(1300,1600);
    Hnew->GetYaxis()->SetTitle("Energy (keV)");
    Hnew->GetXaxis()->SetTitle("Cycle Number");
    Hnew->Draw("COLZ");

    TCutG *cutg = new TCutG("NaIcut1",5);
    cutg->SetVarX("y");
    cutg->SetVarY("x");
    cutg->SetPoint(0,0,1350);
    cutg->SetPoint(1,1500,1350);
    cutg->SetPoint(2,1500,1500);
    cutg->SetPoint(3,0,1500);
    cutg->SetPoint(4,0,1350);
     
    TProfile *profx = Hnew->ProfileX(Form("profx_%d",i),1,-1,"[NaIcut1]");

    profx->SetLineColor(kRed);   
    profx->Draw("same");
    cnew->Update();

    gname = gname + ".pdf";
    cnew->SaveAs(gname.c_str());

  }
    f1.Write();
 
}
开发者ID:tking53,项目名称:root-macros,代码行数:59,代码来源:rotateN.C


示例3: explore_zmass_boost

void explore_zmass_boost()
{
  // Tell root not to draw everything to the screen.
  gROOT->SetBatch();

  //    TString dyfilename         = TString("/home/acarnes/h2mumu/samples/stage1/monte_carlo/bg/stage_1_dy_jetsToLL_asympt50_ALL.root");
  TString dyfilename         = TString("/home/acarnes/h2mumu/samples/stage1/monte_carlo/bg/stage_1_dy_ZToMuMu_asympt50_ALL.root");
  TString datafilename         = TString("/home/acarnes/h2mumu/samples/stage1/data_from_json/Cert_246908-251883_13TeV_PromptReco_Collisions15_JSON_v2/stage_1_doubleMuon_RunBPrompt_MINIAOD.root");

  TString savedir = TString("../png/dy_vs_data/run1cuts_v2_golden_json/dyzmumu/");

  // Initialize the DiMuPlottingSystems for MC and data
  DiMuPlottingSystem* dpsdata = new DiMuPlottingSystem(datafilename);
  DiMuPlottingSystem* dpsdy = new DiMuPlottingSystem(dyfilename);
  addDiMuMassPrimeBranch(dpsdata);
  dpsdata->applyRun1Cuts();
  dpsdy->applyRun1Cuts();

  // Get the 2D histos
  TH2F* hdataZPt = ZMassVsZPtHist2D("data_zpt", "recoCandMassPrime", "(14,0,60,30,87,95)", dpsdata);
  TH2F* hdyZPt = ZMassVsZPtHist2D("dy_zpt", "recoCandMass", "(14,0,60,30,87,95)", dpsdy);

  //overlayTProfiles(TH2F* hdata, TH2F* hdy, TString bininfo, TString savename)
  TProfile* p = overlayTProfiles(hdataZPt, hdyZPt, 90, 92, savedir+"z_mass_vs_z_pt.png");
  gStyle->SetOptFit(0011);
  fitTProfileCustom(p);
  TCanvas* c = new TCanvas();
  c->cd();
  p->Draw("hist c");
  p->Draw("E0 X0 same");
  dpsdata->arrangeStatBox(c);
  c->Draw();
  c->Print("blah2.png");

  // Look at RMS
  c->Clear();
  c->cd();
  c->SetGridx(kTRUE);
  c->SetGridy(kTRUE);
  c->cd();
  TH1F* h = dpsdata->hist1D("recoCandMass", "(100,87,95)", "");
  TH1F* h2 = dpsdata->hist1D("recoCandMassPrime", "(100,87,95)", "");
  h2->SetLineColor(2);
  h->Draw("");
  h2->Draw("same");

  std::cout << "mass  rms: " << h->GetRMS() << std::endl;
  std::cout << "mass' rms: " << h2->GetRMS() << std::endl;
  std::cout << "mass  mean: " << h->GetMean() << std::endl;
  std::cout << "mass' mean: " << h2->GetMean() << std::endl;
  std::cout << "mass  num: " << h->Integral() << std::endl;
  std::cout << "mass' num: " << h2->Integral() << std::endl;

  DiMuPlottingSystem* dps = new DiMuPlottingSystem();
  dps->arrangeStatBox(c);
  c->Draw();
  c->Print("newfit.png");
}
开发者ID:acarnes,项目名称:h2muPlotting,代码行数:58,代码来源:explore_zmass_boost.C


示例4: getPlot

TProfile* getPlot(TProfile *h1, char *var, TCut cut, char *filename, char* treeName)
{
  TFile *inf = new TFile(filename);
  TTree *t = (TTree*)inf->FindObjectAny(treeName);
  TProfile * tmp = (TProfile*)h1->Clone();
  tmp->SetName("tmp");
  t->Draw(Form("%s>>tmp",var),cut);  
  return tmp;
}
开发者ID:ramankhurana,项目名称:usercode,代码行数:9,代码来源:plotPhotonType.C


示例5: TProfile

 void ElectronSimulation::plotTProfile(TTree* treeData )
 {
     TProfile* hprof = new TProfile("hprof", "hprof", 7, -0.5, 9.5);
   
     for (int i = 0; i < 7; ++i)
     { 
         char chargeValueString[100];
         snprintf(chargeValueString,100,"qChargeValues[%i]:%i",i,i);
         treeData->Project("+hprof",chargeValueString);
     }
     hprof->Draw();
 }
开发者ID:sethhirsh,项目名称:Mu2e,代码行数:12,代码来源:classSimulation.C


示例6: profile

void profile()
{
  TCanvas* c1 = new TCanvas("canvas","nhitac",1200,600);
  c1->Divide(2,1);
  c1->cd(1);
  TFile *file1 = new TFile("test_nhitac_modified.root");
  //TH1F  *histo1 = new TH1F("nhitac1","nhitac1",60,0,300);
  TProfile *profile1 = new TProfile("profile","nhitac profile",100,0,100,0,300);

  TFile *file2 = new TFile("test_nhitac_unmodified.root");
  //TH1F  *histo2 = new TH1F("nhitac","nhitac",60,0,300);
  TProfile *profile2 = new TProfile("profile2","nhitac profile2",100,0,100,0,300);
  TProfile *ratio = new TProfile("ratio","nhitac ratio", 100,0,100,0,2);
  //histo2->SetMarkerStyle(31);
  TLegend *l1 = new TLegend(0.20, 0.60, 0.3, 0.7);
  l1->SetBorderSize(0);

  TTree* nhitac_modified = (TTree*)file1->Get("testnhitac");
  TTree* nhitac_unmodified = (TTree*)file2->Get("testnhitac");
  int testnhitac1, testnhitac2;
  nhitac_modified->SetBranchAddress("nhitac",&testnhitac1);
  nhitac_unmodified->SetBranchAddress("nhitac",&testnhitac2);
  for(int i= 0; i < nhitac_modified->GetEntries(); i++)
  {
    nhitac_modified->GetEntry(i);
    nhitac_unmodified->GetEntry(i);
    profile1->Fill(i,testnhitac1);
    profile2->Fill(i,testnhitac2);
    double temp = testnhitac2;
    ratio->Fill(i,testnhitac1/temp);
    //histo1->Fill(testnhitac1);
    //histo2->Fill(testnhitac2);
  }
  //histo1->SetMarkerColor(kRed);
  //histo1->SetLineColor(kRed);
  profile1->SetMarkerColor(kRed);
  profile1->SetMarkerStyle(5);
  profile2->SetMarkerColor(kBlue);
  l1->AddEntry(profile1,"modified od bad channel","P");
  l1->AddEntry(profile2,"old od bad channel","l");
  l1->SetTextSize(0.04);
  profile1->Draw("e1p");
  profile1->GetXaxis()->SetTitle("event #");
  profile1->GetYaxis()->SetTitle("nhitac");
  profile2->Draw("same");
  l1->Draw();
  c1->cd(2);
  ratio->GetXaxis()->SetTitle("event #");
  ratio->GetYaxis()->SetTitle("new/old");
  //ratio->SetMarkerStyle(5);
  //ratio->SetMarkerColor(kRed);
  ratio->Draw();
}
开发者ID:Zepeng,项目名称:od_badch,代码行数:53,代码来源:profile.C


示例7: combExpr

TProfile *MillePedeTrees::CreateHistProf(const char *expX, const char *expY, const char *selection,
                                         const char *hDef, Option_t* opt)
{

  const TString combExpr(Form("%s:%s", expY, expX));
  TH1 *h = this->Draw(combExpr, selection, hDef, "goff prof");

  TProfile *hResult = static_cast<TProfile*>(h->Clone(Form("%sClone", h->GetName())));
  if (opt) hResult->SetOption(opt);

  return hResult;
}
开发者ID:ANSH0712,项目名称:cmssw,代码行数:12,代码来源:MillePedeTrees.C


示例8: TProfile

// Report cut flow findings to screen
void DileptonAnalyzer::reportCutFlow( TFile & outputFile ) {

  // Store in a TProfile
  TProfile *cutFlow = new TProfile("cutFlow","Cut flow for final set of analysis cuts",20,0.5,20.5,-9.9e9,9.9e9);
  TAxis *cutFlowAxis = cutFlow->GetXaxis();

  for ( unsigned int iCut = 0; iCut < cutNamesInOrder_.size(); iCut++ ) {
    cutFlow->Fill( iCut+1, cutFlowMap_[cutNamesInOrder_[iCut]]);
    cutFlowAxis->SetBinLabel( iCut+1, cutNamesInOrder_[iCut]);
  }

  outputFile.cd();
  cutFlow->Write();
}
开发者ID:TENorbert,项目名称:usercode-2,代码行数:15,代码来源:DileptonAnalyzer.C


示例9: drawPtEta

void drawPtEta(char *inf){
TFile a(inf);
a.cd("ana");
TProfile *h = new TProfile("h","",100,-3,3);
TCanvas *c = new TCanvas("c","",400,400);
hi->Draw("(pt):eta>>h","evtType!=92&&evtType!=93&&(abs(eta)<2.4&&chg!=0&&abs(pdg)!=11&&abs(pdg)!=13)","prof",10000);
double nevt = hi->GetEntries("evtType!=92&&evtType!=93");
h->Sumw2();
//h->Scale(2./nevt);
h->SetXTitle("#eta");
h->SetYTitle("Average P_{T}");
h->Draw();
c->SaveAs(Form("%s-PtEta-2.4.gif",inf));
c->SaveAs(Form("%s-PtEta-2.4.C",inf));
}
开发者ID:yenjie,项目名称:usercode,代码行数:15,代码来源:drawPtEta.C


示例10: ProfileY

void KVCanvas::ProfileY(TH2* hh)
{
   TObject* obj = 0;
   if ((obj = gROOT->FindObject(Form("%s_pfy", hh->GetName())))) obj->Delete();
   TProfile* pfy = hh->ProfileY("_pfy", 1, -1, "i");
   TGraphErrors* gr = gHistoManipulator->MakeGraphFrom(pfy);
   pfy->Delete();
   TGraph* gg = gHistoManipulator->PermuteAxis(gr);
   gr->Delete();
   gg->SetName(Form("%s_pfy", hh->GetName()));
   gg->SetLineColor(kBlack);
   gg->Draw("PEZ");
   Modified();
   Update();
}
开发者ID:GiuseppePast,项目名称:kaliveda,代码行数:15,代码来源:KVCanvas.cpp


示例11: _xml

// ============================================================================
StatusCode Gaudi::Utils::Histos::fromXml
( TProfile& result , const std::string& input )
{
  //
  result.Reset() ;                                 // RESET old histogram
  //
  _Xml<TProfile> _xml ;
  std::auto_ptr<TProfile> histo = _xml ( input ) ;
  if ( 0 == histo.get() ) { return StatusCode::FAILURE ; }        // RETURN
  //
  result.Reset() ;
  histo->Copy ( result ) ;
  //
  return StatusCode::SUCCESS ;
}
开发者ID:atlas-org,项目名称:gaudi,代码行数:16,代码来源:HistoXML.cpp


示例12: plotAndProfileX

void plotAndProfileX (TH2* h2, float min, float max, bool profile) {
  setStyle(h2);
  gPad->SetGrid(1,1);
  gStyle->SetGridColor(15);
  h2->GetYaxis()->SetRangeUser(min,max);
  h2->Draw();
  if (profile) {
    TProfile* prof = h2->ProfileX();
    prof->SetMarkerColor(2);
    prof->SetLineColor(2);
    prof->Draw("same");
  }
  TLine * l = new TLine(h2->GetXaxis()->GetXmin(),0,h2->GetXaxis()->GetXmax(),0);
  l->SetLineColor(3);
  l->Draw();
}
开发者ID:cerminar,项目名称:UserCode,代码行数:16,代码来源:macros.C


示例13: printRes

void
HistoCompare::PVCompute(TProfile * oldHisto , TProfile * newHisto , TText * te )
{

  myoldProfile = oldHisto;
  mynewProfile = newHisto;
  myte = te;

  Double_t *res ;

  Double_t mypv = myoldProfile->Chi2Test(mynewProfile,"WW",res);
  TString title = myoldProfile->GetName();
  printRes(title, mypv, myte);
  return;

}
开发者ID:DesyTau,项目名称:cmssw,代码行数:16,代码来源:MECompare.C


示例14: smartGausProfileXSQRTN

TH1D * smartGausProfileXSQRTN (TH2F * strip, double width){
 TProfile * stripProfile = strip->ProfileX () ;
 
 // (from FitSlices of TH2.h)
 
 double xmin = stripProfile->GetXaxis ()->GetXmin () ;
 double xmax = stripProfile->GetXaxis ()->GetXmax () ;
 int profileBins = stripProfile->GetNbinsX () ;
 
 std::string name = strip->GetName () ;
 name += "_smartGaus_X" ; 
 TH1D * prof = new TH1D(name.c_str (),strip->GetTitle (),profileBins,xmin,xmax) ;
 
 int cut = 0 ; // minimum number of entries per fitted bin
 int nbins = strip->GetXaxis ()->GetNbins () ;
 int binmin = 1 ;
 int ngroup = 1 ; // bins per step
 int binmax = nbins ;
 
 // loop over the strip bins
 for (int bin=binmin ; bin<=binmax ; bin += ngroup) 
 {
  TH1D *hpy = strip->ProjectionY ("_temp",bin,bin+ngroup-1,"e") ;
  if (hpy == 0) continue ;
  int nentries = Int_t (hpy->GetEntries ()) ;
  if (nentries == 0 || nentries < cut) {delete hpy ; continue ;} 
  
  Int_t biny = bin + ngroup/2 ;
  
  TF1 * gaussian = new TF1 ("gaussian","gaus", hpy->GetMean () - width * hpy->GetRMS (), hpy->GetMean () + width * hpy->GetRMS ()) ; 
  gaussian->SetParameter (1,hpy->GetMean ()) ;
  gaussian->SetParameter (2,hpy->GetRMS ()) ;
  hpy->Fit ("gaussian","RQL") ;           
  
  //       hpy->GetXaxis ()->SetRangeUser ( hpy->GetMean () - width * hpy->GetRMS (), hpy->GetMean () + width * hpy->GetRMS ()) ;         
  prof->Fill (strip->GetXaxis ()->GetBinCenter (biny), gaussian->GetParameter (1)) ;       
  prof->SetBinError (biny,gaussian->GetParameter (2) / sqrt(hpy->GetEntries())) ;
//   prof->SetBinError (biny,gaussian->GetParError (1)) ;
  
  delete gaussian ;
  delete hpy ;
 } // loop over the bins
 
 delete stripProfile ;
 return prof ;
}
开发者ID:amassiro,项目名称:usercode,代码行数:46,代码来源:EE_EnScale.cpp


示例15: show_mass_dist

void show_mass_dist()
{
    TFile *file_f = new TFile("particle_mass_dist.root");

    TH2F *hm = (TH2F *) file_f->Get("mass_dist");
    TProfile *pm = (TProfile *) file_f->Get("mass_dist_p");

    TCanvas *cm = new TCanvas("cm", "Mass", 1000, 500);
    cm->Divide(2, 1);

    pm->SetLineColor(4);

    cm->cd(1);
    hm->Draw();
    cm->cd(2)->SetBorderMode(0);
    pm->Draw();
}
开发者ID:HaykHakobyan,项目名称:Analyser,代码行数:17,代码来源:show_mass_dist.C


示例16: plotAndProfileXSpread

// Draw a 2-D plot within the specified Y range and superimpose its X profile,
// setting as sigmas that of the fit (and not the error of the mean)
void plotAndProfileXSpread (TH2* h2, float min, float max, bool profile=false, float ymin=-5., float ymax=5.) {
  setStyle(h2);
  gPad->SetGrid(1,1);
  gStyle->SetGridColor(15);
  gStyle->SetOptStat(0);
  // h2->RebinX(3);
  // h2->RebinY(2);
  // h2->SetXTitle("distance from anode (cm)");
  // h2->SetYTitle("(d_{reco}-d_{sim})/#sigma_{reco}");
  h2->SetMarkerColor(2);
  h2->SetLineColor(2);
  h2->GetYaxis()->SetTitleOffset(1.4);
  h2->GetXaxis()->SetRangeUser(min,max);
  h2->GetYaxis()->SetRangeUser(ymin,ymax);
  h2->DrawCopy("box");
  if (profile) {
    TProfile* prof = h2->ProfileX("profile",-1,-1,"s");
    prof->SetMarkerStyle(20);
    prof->SetMarkerSize(1.2);
    prof->SetMarkerColor(1);
    prof->SetLineColor(1);
    prof->SetLineWidth(2);
    prof->DrawCopy("same e1");
    delete prof;
  }
  TLine * l = new TLine(h2->GetXaxis()->GetXmin(),0,h2->GetXaxis()->GetXmax(),0);
  l->SetLineColor(3);
  l->Draw();
}
开发者ID:aashaqshah,项目名称:cmssw-1,代码行数:31,代码来源:macros.C


示例17: plotIsoPerformance

TProfile* plotIsoPerformance( TFile* ftt, 
			      const char* signal,     // histogram name
			      const char* background, // histogram name
			      const char* name,       // unique name
			      bool reverse = false,   // normally signal near zero bin, reverse means signal is around max bin
			      double bkg_eff_min = 0,
			      double bkg_eff_max = 1,
			      double sig_eff_min = 0,
			      double sig_eff_max = 0
			      )
{ 
  TH1F* S = dynamic_cast<TH1F*>(ftt->Get(signal));
  if ( ! S ) {
    std::cout << "Error: histogram not found " << signal << std::endl;
    return 0;
  }
  TH1F* B = dynamic_cast<TH1F*>(ftt->Get(background));
  if ( ! B ) {
    std::cout << "Error: histogram not found " << background << std::endl;
    return 0;
  }
  char buf[1024];
  sprintf(buf,"c_%s",name);
  // TCanvas* c = new TCanvas(buf,buf,500,500);
  sprintf(buf,"p_%s",name);
  TProfile* p = new TProfile(buf,buf,50,bkg_eff_min,bkg_eff_max,sig_eff_min,sig_eff_max);
  p->SetLineColor(kBlue);
  p->SetLineWidth(2);
  p->SetMarkerStyle(20);
  p->SetMarkerSize(1);
  p->GetXaxis()->SetTitle("Background Efficiency");
  p->GetYaxis()->SetTitle("Signal Efficiency");
  p->SetStats(kFALSE);
  for( int i=0;i<=S->GetNbinsX()+1; ++i )
    if ( reverse ) 
      p->Fill(B->Integral(i,B->GetNbinsX()+1)/B->Integral(0,B->GetNbinsX()+1),
	      S->Integral(i,S->GetNbinsX()+1)/S->Integral(0,S->GetNbinsX()+1));
    else
      p->Fill(B->Integral(0,i)/B->Integral(0,B->GetNbinsX()+1),
	      S->Integral(0,i)/S->Integral(0,S->GetNbinsX()+1));
  // p->Draw();
  return p;
}
开发者ID:magania,项目名称:CMS2,代码行数:43,代码来源:doPlots.C


示例18: meanY

//------------------------------------------------------------------------------
double meanY( char* hs ) // for profiles only
{
  TObject* obj = gDirectory->Get(hs);
  if( !obj->InheritsFrom( "TProfile" ) ) {
    cout << hs << " is not profile plot" << endl;
    return 0;
  }
  TProfile* p = (TProfile*)obj;
  double sumw = 0;
  double sumy = 0;
  for( int i = 1; i <= p->GetNbinsX(); ++i ) { // bin 0 is underflow
    double w = p->GetBinEntries(i);
    sumw += w;
    sumy += w * p->GetBinContent(i);
  }
  if( sumw > 0.1 )
    return sumy/sumw;
  else
    return 0;
}
开发者ID:schuetzepaul,项目名称:testbeam-analysis,代码行数:21,代码来源:t.C


示例19: NavigationTree_DisplayProfilesToogle

void
NavigationTree_DisplayProfilesToogle()
	{
	TProfile * pProfileSelected = g_oConfiguration.m_pProfileSelected;
	if (pProfileSelected != NULL)
		{
		if (pProfileSelected->m_paTreeItemW_YZ == NULL)
			{
			pProfileSelected->TreeItemProfile_DisplayProfileInfoWithinNavigationTree();
			pProfileSelected->TreeItemW_Expand();
			pProfileSelected->TreeItemLayout_SetFocus();
			return;
			}
		pProfileSelected->TreeItemW_ToggleVisibilityAndSetFocus();
		}
	else if (g_pTreeItemProfiles != NULL)
		{
		g_pTreeItemProfiles->TreeItemW_ToggleVisibilityAndSetFocus();
		}
	}
开发者ID:voodoo-chile,项目名称:Cambrian-src,代码行数:20,代码来源:ProfileSwitching.cpp


示例20: Assert

IXmlExchange *
IApplication::S_PaAllocateApplication_YZ(POBJECT poProfileParent, const CXmlNode * pXmlNodeElement)
    {
    Assert(pXmlNodeElement != NULL);
    TProfile * pProfileParent = (TProfile *)poProfileParent;
    Assert(pProfileParent->EGetRuntimeClass() == RTI(TProfile));
    // Find the type of application to allocate
    PSZUC pszClass = pXmlNodeElement->PszuFindAttributeValue_NZ(c_szaApplicationClass_);
    const SApplicationAllocator * pApplicationAllocator = c_rgzApplicationAllocators;
    while (TRUE)
        {
        if (pApplicationAllocator->pszClass == NULL)
            break;
        Assert(pApplicationAllocator->pfnAllocator != NULL);
        if (FCompareStrings(pApplicationAllocator->pszClass, pszClass))
            return pApplicationAllocator->pfnAllocator(pProfileParent);
        pApplicationAllocator++;	// Search the next application
        } // while
    MessageLog_AppendTextFormatSev(eSeverityErrorWarning, "Unable to find application of class '$s'\n", pszClass);
    return NULL;
    }
开发者ID:voodoo-chile,项目名称:Cambrian-src,代码行数:21,代码来源:IApplication.cpp



注:本文中的TProfile类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ TPt类代码示例发布时间:2022-05-31
下一篇:
C++ TPositionInfo类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap