当前位置: 首页>>代码示例>>C++>>正文


C++ TLine::SetBit方法代码示例

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


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

示例1: AddAnalysisMarkers

void RangePlotter::AddAnalysisMarkers(int a_iPanelIndex, SignalAnalyzer::AnalysisMarkers& a_analysisMarkers)
{
	m_pCanvas->cd(a_iPanelIndex + 1);
//	printf("pulse threshold: %f\n", a_analysisMarkers.GetPulseThreshold().Continuous());
	TLine* pulseThresholdLine = new TLine(0, a_analysisMarkers.GetPulseThreshold().Continuous(), m_vpMultiGraph[a_iPanelIndex]->GetXaxis()->GetXmax(), a_analysisMarkers.GetPulseThreshold().Continuous());
	pulseThresholdLine->SetLineStyle(2);
	pulseThresholdLine->SetBit(kCanDelete);
//	printf("edge threshold: %f\n", a_analysisMarkers.GetEdgeThreshold().Continuous());
	TLine* edgeThresholdLine = new TLine(0, a_analysisMarkers.GetEdgeThreshold().Continuous(), m_vpMultiGraph[a_iPanelIndex]->GetXaxis()->GetXmax(), a_analysisMarkers.GetEdgeThreshold().Continuous());
	edgeThresholdLine->SetLineStyle(2);
	edgeThresholdLine->SetBit(kCanDelete);
	
/*	int i = 0;
	for (auto& it: a_analysisMarkers.m_vChannelsEdgeAndMinimum)
	{
		int color = ((TGraph*) m_vpMultiGraph[a_iPanelIndex]->GetListOfGraphs()->At(i))->GetLineColor();
		float fYMin = m_vpMultiGraph[a_iPanelIndex]->GetYaxis()->GetXmin();
		float fYMax = m_vpMultiGraph[a_iPanelIndex]->GetYaxis()->GetXmax();

		if (std::get<EDGE_THRES_INDEX>(it).Exists())
		{	
			TMarker* markerMin = new TMarker(std::get<MIN_PULSE_INDEX>(it).GetX(), std::get<MIN_PULSE_INDEX>(it).GetY(), 22);
			markerMin->SetMarkerColor(color);
			markerMin->SetMarkerSize(2);
			markerMin->Draw();

			TBox* pulseWindow = new TBox(std::get<EDGE_THRES_INDEX>(it).GetX(), fYMin, std::get<EDGE_THRES_INDEX>(it).GetX() + a_analysisMarkers.GetExpectedPulseWidth().Continuous(), fYMax);
			pulseWindow->SetFillColor(color);
			pulseWindow->SetFillStyle(3004);
			pulseWindow->Draw();
		}
		i++;
	}
*/
	if (Configuration::Instance().TagPrimaryPulseStep())
	{
		for (auto& it: a_analysisMarkers.m_vChannelsWithPulse)
		{		
			m_vpGraph[it]->SetLineWidth(3);
		}
	}

	if (Configuration::Instance().ShowEdgeThresholdMarkerStep())
	{
		pulseThresholdLine->Draw();
	}
	
	if (Configuration::Instance().ShowPulseThresholdMarkerStep())
	{
		edgeThresholdLine->Draw();
	}

	m_pCanvas->Update();
}
开发者ID:davereikher,项目名称:pps-daq,代码行数:54,代码来源:RangePlotter.cpp

示例2: drawResult

void HistoData::drawResult(TH1 *Summary, bool Vertical, bool SetBinLabel) {

  // add label to the summary if desired
  if (SetBinLabel) {
    Summary->GetXaxis()->SetBinLabel(bin,getRefHisto()->GetTitle());
    //Summary->GetXaxis()->SetBinLabel(bin,name.c_str());
  }
  else 
    Summary->GetXaxis()->SetBinLabel(bin,name.c_str());

  double minimum = Summary->GetMinimum();
  // determine where to draw the result (score axis)
  //   1: solid bar starts
  //   2: solid bar ends, hatched bar starts
  //   3: hatched bar ends
  double score1 = minimum;
  double score2 = (lowScore == 10. || lowScore < minimum) ? minimum : lowScore;
  double score3 = (lowScore == 10.) ? 1 : ((highScore < minimum) ? minimum : highScore);

  // determine where to draw the result (binning axis)
  double binCenter = Summary->GetBinCenter(bin);
  double binWidth = Summary->GetBinWidth(bin);
  double bin1 = binCenter - binWidth / 3;
  double bin2 = binCenter + binWidth / 3; 

  // set coordinates of display based on plot alignment
  double solidX1, solidY1, solidX2, solidY2;
  double hatchedX1, hatchedY1, hatchedX2, hatchedY2;
  double axisX1, axisY1, axisX2, axisY2;
  if (Vertical) {
    solidX1 = bin1; solidX2 = bin2;
    solidY1 = score1; solidY2 = score2;
    hatchedX1 = bin1; hatchedX2 = bin2;
    hatchedY1 = score2; hatchedY2 = score3;
    axisX1 = bin1; axisX2 = bin2;
    axisY1 = minimum; axisY2 = minimum;
  } else {
    solidX1 = score1; solidX2 = score2;
    solidY1 = bin1; solidY2 = bin2;
    hatchedX1 = score2; hatchedX2 = score3;
    hatchedY1 = bin1; hatchedY2 = bin2;
    axisX1 = minimum; axisX2 = minimum;
    axisY1 = bin1; axisY2 = bin2;
  }

  // a solid bar is drawn from zero to the lowest score
  if (lowScore > minimum && lowScore != 10.) {
    TPave *solidBar = new TPave(solidX1,solidY1,solidX2,solidY2,1,"");
    solidBar->SetBit(kCanDelete);
    solidBar->SetLineColor(lineUseFillColor ? solidFillColor : solidLineColor);
    solidBar->SetFillColor(solidFillColor);
    solidBar->SetFillStyle(solidFillStyle);
    solidBar->Draw();
  }

  // a hatched bar is drawn from the lowest score to the highest score
  if ((lowScore != highScore && highScore > minimum) || lowScore == 10.) {
    TPave *hatchedBar = new TPave(hatchedX1,hatchedY1,hatchedX2,hatchedY2,1,"");
    hatchedBar->SetBit(kCanDelete);
    hatchedBar->SetLineColor(lineUseFillColor ? shadedFillColor : shadedLineColor);
    hatchedBar->SetFillColor(shadedFillColor);
    hatchedBar->SetFillStyle(3004);
    hatchedBar->Draw();
  }

  // paste a line over the base axis to fix border color artifacts
  TLine *axisLine = new TLine(axisX1,axisY1,axisX2,axisY2);
  if (Vertical) axisLine->SetLineColor(Summary->GetAxisColor("X"));
  else axisLine->SetLineColor(Summary->GetAxisColor("Y"));
  axisLine->SetBit(kCanDelete);
  axisLine->Draw("SAME");

  //paste a line before (in this proceeding that means after) Barrel and Endcap Plots
  if ( name == "ERPt" || name == "BRPt" ) {
    axisY1=axisY2=binCenter+binWidth/2;
    axisX2=Summary->GetMaximum();
    axisX1=Summary->GetMinimum()-200;
    TLine *regionLine = new TLine(axisX1,axisY1,axisX2,axisY2);
    regionLine->SetLineColor(Summary->GetAxisColor("X"));
    regionLine->SetBit(kCanDelete);
    regionLine->SetLineWidth(3);
    regionLine->Draw();
  }
}
开发者ID:Andrej-CMS,项目名称:cmssw,代码行数:84,代码来源:HistoData.cpp


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