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


C++ TView类代码示例

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


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

示例1: AddGrid

//_______________________________________________________________________________________
static void AddGrid()
{ 
  TVirtualPad *thisPad = qPad();

  if (thisPad) {
 
    TView *view = thisPad->GetView(); 
    if (!view) return;
    Double_t min[3],max[3];
    view->GetRange(min,max);

    TList *list      = thisPad->GetListOfPrimitives();
    TString histName = thisPad->GetName();
    TH2F *m_DummyHist = 0; 
    const Char_t *dummyName = "Axis3D";
    histName += dummyName;
    m_DummyHist = list->FindObject(histName.Data());
    if (!m_DummyHist) { 
      m_DummyHist = new TH2F(histName.Data(),"",1,min[0],max[0],1,min[1],max[1]);
      m_DummyHist->SetDirectory(0);
      m_DummyHist->Draw("surf,same");
    }
    m_DummyHist->GetXaxis()->SetLimits(min[0],max[0]);
    m_DummyHist->GetYaxis()->SetLimits(min[1],max[1]);
    m_DummyHist->GetZaxis()->SetLimits(min[2],max[2]);
 
    thisPad->Modified();
    thisPad->Update();
  }
}
开发者ID:star-bnl,项目名称:star-macros,代码行数:31,代码来源:PadControlPanel.C

示例2: TWindowInit

TAsciiChart::TAsciiChart() :
        TWindowInit(&TAsciiChart::initFrame), TWindow(TRect(0, 0, 34, 12), "ASCII Chart",
                wnNoNumber) {
    TView *control;

    flags &= ~(wfGrow | wfZoom);
    palette = wpGrayWindow;

    TRect r = getExtent();
    r.grow(-1, -1);
    r.a.y = r.b.y - 1;
    control = new TReport(r);
    control->options |= ofFramed;
    control->eventMask |= evBroadcast;
    insert(control);

    r = getExtent();
    r.grow(-1, -1);
    r.b.y = r.b.y - 2;
    control = new TTable(r);
    control->options |= ofFramed;
    control->options |= ofSelectable;
    control->blockCursor();
    insert(control);
    control->select();
}
开发者ID:idispatch,项目名称:tvtest,代码行数:26,代码来源:main.cpp

示例3: findNext

void TGroup::selectNext( Boolean forwards )
{
    if( current != 0 )
    {
        TView* p = findNext(forwards);
    if (p) p->select();
    }
}
开发者ID:NoSuchProcess,项目名称:OrangeC,代码行数:8,代码来源:tgroup.cpp

示例4: focusNext

Boolean TGroup::focusNext(Boolean forwards) {
   TView *p;

   p = findNext(forwards);
   if (p)
      return p->focus();
   else
      return True;
}
开发者ID:OS2World,项目名称:SYSTEM-LOADER-QSINIT,代码行数:9,代码来源:tgroup.cpp

示例5: 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();
  }
}
开发者ID:star-bnl,项目名称:star-macros,代码行数:58,代码来源:PadControlPanel.C

示例6: setData

void TGroup::setData(void *rec) {
   size_t i = 0;
   if (last!= 0) {
      TView *v = last;
      do  {
         v->setData((char *)rec + i);
         i += v->dataSize();
         v = v->prev();
      } while (v != last);
   }
}
开发者ID:OS2World,项目名称:SYSTEM-LOADER-QSINIT,代码行数:11,代码来源:tgroup.cpp

示例7: TopView

void TStatusLine::update()
{
    TView *p = TopView();
    ushort h = ( p != 0 ) ? p->getHelpCtx() : hcNoContext;
    if( helpCtx != h )
        {
        helpCtx = h;
        findItems();
        drawView();
        }
}
开发者ID:LucasvBerkel,项目名称:TweedejaarsProject,代码行数:11,代码来源:TSTATUSL.CPP

示例8: getData

void TGroup::getData(void *rec)
{
    ushort i = 0;
    if (last != 0 )
        {
        TView* v = last;
        do  {
            v->getData( ((char *)rec) + i );
            i += v->dataSize();
            v = v->prev();
            } while( v != last );
        }
}
开发者ID:NoSuchProcess,项目名称:OrangeC,代码行数:13,代码来源:tgroup.cpp

示例9: pl3

 void pl3() {
      TCanvas *c1 = new TCanvas("c1");
      TView *view = TView::CreateView(1);
      view->SetRange(0,0,0,2,2,2);
      const Int_t n = 100;
      TPolyLine3D *l = new TPolyLine3D(n);
      for (Int_t i=0;i<n;i++) {
         Double_t x = 2*gRandom->Rndm();
         Double_t y = 2*gRandom->Rndm();
         Double_t z = 2*gRandom->Rndm();
         l->SetPoint(i,x,y,z);
      }
      l->Draw();
   }
开发者ID:camsonne,项目名称:g4sbsDDVCS,代码行数:14,代码来源:pl3.C

示例10: drawing_pion_decay

void drawing_pion_decay(){

	double Pi_lifetime = 0.26033e-6; //s
	double c = 3e8;//m/s
	TCanvas *c1 = new TCanvas("test", "test");
	TRandom *r = new TRandom();
	

	TView *view = TView::CreateView(1, 0, 0);
	view->ShowAxis();
	view->SetRange(-5, -5, 0, 5, 5, 10);
	
	

	for (int i = 0; i < 100; ++i)
	{
		double px = 0.3;
		double py = 0.3;
		double pz = -1; // GeV
		double energy = sqrt(px*px+py*py+pz*pz+M_pion*M_pion);
		
		//life time
		double t = r->Exp(Pi_lifetime);
		//decay length
		double gamma = energy/M_pion;
		double length = c*t*gamma/1e3;
		// decay position
		double vx = 0;
		double vy = 0;
		double vz = 10 - length;

		TLorentzVector pion(px, py, pz, energy);

		double decay_particle_mass[2] = {M_muon, M_neu};
		TGenPhaseSpace event;
		event.SetDecay(pion, 2, decay_particle_mass);
		event.Generate();

		TLorentzVector Muon = *(event.GetDecay(0));
		TLorentzVector Neu = *(event.GetDecay(1));
		
		plot_particle(Muon, vx, vy, vz, 2);
		plot_particle(Neu, vx, vy, vz, 4);


	}


}
开发者ID:TuringTW,项目名称:ntu_2015_fall,代码行数:49,代码来源:drawing_pion_decay.C

示例11: Inscrease3DScale

//_______________________________________________________________________________________
static void Inscrease3DScale()
{
  TVirtualPad *thisPad = qPad();
  if (thisPad) {
    TView *view = thisPad->GetView(); 
    if (!view) return;
    Double_t min[3],max[3];
    view->GetRange(min,max);
    int i;
    for (i=0;i<3; i++) {max[i] *= 0.8; min[i]=max[i]*0.1;}
    view->SetRange(min,max);
    thisPad->Modified();
    thisPad->Update();
  }
}
开发者ID:star-bnl,项目名称:star-macros,代码行数:16,代码来源:PadControlPanel.C

示例12: while

//
/// Notifies the views of the current document and the views of any child documents
/// of a change. In contrast to QueryViews, NotifyViews sends notification of an
/// event to all views and returns true if all views returned a true result. The
/// event, EV_OWLNOTIFY, is sent with an event code, which is private to the
/// particular document and view class, and a long argument, which can be cast
/// appropriately to the actual type passed in the argument of the response
/// function.
//
bool
TDocument::NotifyViews(int event, long item, TView* exclude)
{
  bool answer = true;

  TDocument* pdoc = 0;
  while ((pdoc = ChildDoc.Next(pdoc)) != 0)
    answer = (answer && pdoc->NotifyViews(event, item, exclude));

  TEventHandler::TEventInfo eventInfo(WM_OWLNOTIFY, event);
  for (TView* view = ViewList; view != 0; view = view->NextView)
    if (view != exclude && view->Find(eventInfo))
      answer = (answer && (view->Dispatch(eventInfo, 0, item) != 0));

  return answer;
}
开发者ID:Darkman-M59,项目名称:Meridian59_115,代码行数:25,代码来源:document.cpp

示例13: execDialog

ushort execDialog( TDialog *d, void *data )
{
    TView *p = TProgram::application->validView( d );
    if( p == 0 )
        return cmCancel;
    else
        {
        if( data != 0 )
            p->setData( data );
        ushort result = TProgram::deskTop->execView( p );
        if( result != cmCancel && data != 0 )
            p->getData( data );
        TObject::destroy( p );
        return result;
        }
}
开发者ID:OS2World,项目名称:DEV-CPLUSPLUS-UTIL-Turbo_Vision_C--,代码行数:16,代码来源:TVEDIT2.CPP

示例14: Centered3DImages

//_______________________________________________________________________________________
static void Centered3DImages()
{
  // This macro prints out the sizes of the sekected 3d pad
  TVirtualPad *thisPad = qPad();
  if (thisPad) {
    TView *view = thisPad->GetView(); 
    if (!view) return;
    Double_t min[3],max[3];
    view->GetRange(min,max);
    int i;
    for (i=0;i<3; i++) min[i]=-max[i];
    view->SetRange(min,max);
    thisPad->Modified();
    thisPad->Update();
 }
}
开发者ID:star-bnl,项目名称:star-macros,代码行数:17,代码来源:PadControlPanel.C

示例15: first

void TObjDlg::handleNotification( TView *view )
{
	if( view == this )
		{
		TView *v = first();
		do
			{
			if( v->dataSize() > 0 )
				owner->handleNotification( v );

			v = v->nextView();
			}
		while( v );
		}
	else
		owner->handleNotification( view );
}
开发者ID:jskripsky,项目名称:ancient,代码行数:17,代码来源:TOBJDLG.CPP


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