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

C++ TView类代码示例

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

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



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


示例16: RotateView

//_______________________________________________________________________________________
static void RotateView(Float_t phi, Float_t theta, TVirtualPad *pad=0)
{
  TVirtualPad *thisPad = pad;
  if (!thisPad) thisPad = qPad();
  if (thisPad) {
    TView *view = thisPad->GetView(); 
    if (view) {
      Int_t iret;
      Float_t p = phi;
      Float_t t = theta;
      view->SetView(p, t, 0, iret);
      thisPad->SetPhi(-90-p);
      thisPad->SetTheta(90-t);
      thisPad->Modified();
      thisPad->Update();
    }
  }
}
开发者ID:star-bnl,项目名称:star-macros,代码行数:19,代码来源:PadControlPanel.C


示例17: mapColor

uchar TView::mapColor( uchar color )
{
    if( color == 0 )
        return errorAttr;
    TView *cur = this;
    do  {
        TPalette& p = cur->getPalette();
        if( p[0] != 0 )
            {
            if( color > p[0] )
                return errorAttr;
            color = p[color];
            if( color == 0 )
                return errorAttr;
            }
        cur = cur->owner;
        } while( cur != 0 );
    return color;
}
开发者ID:NoSuchProcess,项目名称:OrangeC,代码行数:19,代码来源:mapcolor.cpp


示例18: kernel_fill

CUGIP_GLOBAL void 
kernel_fill(TView aView, TType aValue)
{
	typename TView::coord_t coord(blockIdx.x * blockDim.x + threadIdx.x, blockIdx.y * blockDim.y + threadIdx.y);
	typename TView::extents_t extents = aView.dimensions();

	if (coord.template get<0>() < extents.template get<0>() && coord.template get<1>() < extents.template get<1>()) {
		aView[coord] = aValue;
	} 
}
开发者ID:JanKolomaznik,项目名称:cugip,代码行数:10,代码来源:fill.hpp


示例19: AdjustScales

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


示例20: spheres

void spheres(Int_t nspheres=20, Int_t npoints=100000) {
   // generate random points uniformly distributed over the surface
   // of spheres generated at random positions.

   TCanvas *c1 = new TCanvas("c1","spheres",600,600);
   c1->SetFillColor(kBlack);
   TView *view = new TView(1);
   Double_t k=0.8;
   view->SetRange( -k, -k, -k, k, k, k);
   
   //generate sphere coordinates and radius
   TRandom r;
   if (nspheres <=0) nspheres = 10;
   Double_t *xs = new Double_t[nspheres];
   Double_t *ys = new Double_t[nspheres];
   Double_t *zs = new Double_t[nspheres];
   Double_t *rs = new Double_t[nspheres];
   Int_t i;
   for (i=0;i<nspheres;i++) {
      xs[i] = r.Uniform(-1,1);
      ys[i] = r.Uniform(-1,1);
      zs[i] = r.Uniform(-1,1);
      rs[i] = r.Uniform(0.05,0.25);
   }

   //generate points
   TPolyMarker3D *pm = new TPolyMarker3D(npoints);
   pm->SetMarkerColor(kRed);
   Double_t x,y,z;
   for (Int_t j=0;j<npoints;j++) {
       i = (Int_t)r.Uniform(0,nspheres);  //choose sphere
       r.Sphere(x,y,z,rs[i]);
       pm->SetPoint(j,xs[i]+x, ys[i]+y,zs[i]+z);
   }
   
   delete [] xs;
   delete [] ys;
   delete [] zs;
   delete [] rs;
    
   pm->Draw();
}
开发者ID:alcap-org,项目名称:AlcapDAQ,代码行数:42,代码来源:spheres.C



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ TVirtualPad类代码示例发布时间:2022-05-31
下一篇:
C++ TVectorImageP类代码示例发布时间: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