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

C++ TutorialApplication类代码示例

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

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



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

示例1: main

    int main(int argc, char *argv[])
#endif
    {
		TRACE_APPNAME("Ogre_App");
		TRACE_CONNECT();
		TRACE_MSG(trace::e_Info, trace::CTX_Default, "Initialized main application");

		// redirect Ogre log to our listener
        LogRedir redir;
        Ogre::LogManager * mLogManager = OGRE_NEW Ogre::LogManager();
        Ogre::Log * log = Ogre::LogManager::getSingleton().createLog("", true, false, false);
        if (log)
            log->addListener(&redir);

        // Create application object
        TutorialApplication app;

        try {
            app.go();
        } catch( Ogre::Exception& e ) {
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
            MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
#else
            std::cerr << "An exception has occured: " <<
                e.getFullDescription().c_str() << std::endl;
#endif
        }

        if (log)
            log->removeListener(&redir);
        return 0;
    }
开发者ID:BackupTheBerlios,项目名称:flogging,代码行数:32,代码来源:TutorialApplication.cpp


示例2: main

int main(int argc, char *argv[])
{
  dsr::ArgumentHelper ah;

  ah.new_string("input_filename.vtk", "The name of the input file", input_filename);
  //ah.new_string("output_filename", "The name of the output file", output_filename);
  
  //ARGUMENT_HELPER_BASICS(ah);
  ah.set_description("STEP2: A simple tutorial application for the X3DLoader library");
  ah.set_author("Kristian Sons, [email protected]");
  ah.set_version(0.9f);
  ah.set_build_date(__DATE__);

  ah.process(argc, argv);


  // Check output string
  if (fileExists(input_filename))
  {
	  TutorialApplication app;
	  app.setX3DFile(input_filename.c_str());

	  try {
		  app.go();
	  } catch( Exception& e ) {
		  fprintf(stderr, "An exception has occurred: %s\n",
			  e.getFullDescription().c_str());
	  }

	  return 0;
  }
  cerr << "Input file not found or not readable: " << input_filename << endl;
  return 1;
}
开发者ID:Aerochip7,项目名称:trunk,代码行数:34,代码来源:main.cpp


示例3: main

int main(int argc, char *argv[])
{
    // Create application object
    TutorialApplication app;

    try {
        app.go();
    } catch( Ogre::Exception& e ) {
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
#else
        std::cerr << "An exception has occured: " <<
            e.getFullDescription().c_str() << std::endl;
#endif
    }

    return 0;
}
开发者ID:uspgamedev,项目名称:3D-experiment,代码行数:18,代码来源:TutorialApplication.cpp


示例4: calibrateEM

void calibrateEM()
{

  // FIXME: There are two possibilities to execute the script:
  // i) root run_hadron_g4.C
  //    root[] .L calibrateEM.C
  //    root[] calibrateEM()
  // or ii) Include the basics from run_hadron_g4.C here and
  //    execute simply:
  //    root calibrateEM.C
  // Load basic libraries
   // Load basic libraries
  gROOT->LoadMacro("/opt/geant4_vmc.2.15a/examples/macro/basiclibs.C");
  basiclibs();

  // Load Geant4 libraries
  gROOT->LoadMacro("/opt/geant4_vmc.2.15a/examples/macro/g4libs.C");
  g4libs();
  
  // Load the tutorial application library
  gSystem->Load("libTutorialApplication");
  
  // MC application
  TutorialApplication* app 
    = new TutorialApplication("TutorialApplication",
			      "Tutorial Application for HEP Lecture @EKP");
  
  // configure Geant4
  gROOT->LoadMacro("g4Config.C");
  Config();

 // instantiate graphical user interface for tutorial application
 new TutorialMainFrame(app);
  //FIXME: Load "CountChargedinScint.C"
  gROOT->ProcessLine(".L CountChargedinScint.C");

  //FIXME: Initialize the geometry
  app->InitMC("geometry/calor(1,0.2)");
  //FIXME: Set the primary particle to photon
  app->SetPrimaryPDG(22);
  // Profile histogram - will show us the mean numbers of counts in bins of the energy.
  // The given binning refers to the energy, the other binning will be inferred automatically.
  TProfile* hcounts = new TProfile("hcounts","Counts per particle energy",
				   10,0,10);
  hcounts->SetXTitle("energy [GeV]");
  hcounts->SetYTitle("mean number of counts");

  // FIXME loop over different particle momenta, and for each momentum simulate several events (e.g. 10)
  for(Int_t i = 0 ; i < 10 ; ++i) {
    for(Int_t k = 0 ; k < 10; k ++) {
    //FIXME: Set the momentum of the primary particle to p
      Double_t p = i;
      app->SetPrimaryMomentum(p);
    //FIXME: Run the simulation
      app->RunMC();
    //FIXME: Fill both the momentum and the output from CountChargedinScint
    //        into the profile histogram hcounts
      Double_t x = CountChargedinScint();
      hcounts->Fill(p,x);
    }
  }

  TCanvas* c = new TCanvas();
  c->cd();
  hcounts->Draw();

  TF1 *fitter = new TF1("fitf","[0]*x", 0,10);
  fitter->SetParameter(0,1.0);
  fitter->SetParNames("calibration factor");
  //FIXME: Fit the histogram to get the calibration factor
  hcounts->Fit("fitf");
}
开发者ID:harrypuuter,项目名称:tp1,代码行数:72,代码来源:calibrateEM.C



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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