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

C++ Tools类代码示例

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

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



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

示例1: plotEwithFilter

//----------------------------------------//
// Vector potential plots
//----------------------------------------//
void plotEwithFilter(vector<TString> fnames, 
		     vector<TString> lnames,
		     vector<float> scales)
{

  // Hist attributes
  TString xtitle = "frequency [Hz]";
  TString ytitle = "|E(t)| [V/m]";
  float xmin = -999;
  float xmax = -999;
  TString savename = "EwithFilter";

  // Filter frequency
  float fmin = 200e6;
  float fmax = 400e6;

  // Get Tool for FT
  Tools* fttool = new Tools();

  // Load the histograms that are of interest
  vector<TH1F*> hists;
  for(unsigned int i=0; i<fnames.size(); ++i){
    TFile* file  = new TFile(fnames.at(i));
    TH1F* E_td   = SummaryMag->getE(0);
    TH1F* E_fd   = fttool->getFTFD(E_td);
    hists.push_back( fttool->getFTTD(E_td, E_fd, fmin, fmax) );
    hists.back()->SetDirectory(0);
    setHistAtt(hists.back(), xtitle, ytitle, m_colors[i], m_markers[i]);
    hists.back()->Scale(scales.at(i));
    file->Close();
  }// end loading of histograms
  
  plot(hists, lnames, savename, xmin, xmax, false);

}
开发者ID:mrelich,项目名称:IceBlockAna,代码行数:38,代码来源:WidthComparison.C


示例2: AddTool

static int AddTool(lua_State *L) {
	Tool* tool = (Tool*) lua_touserdata(L, -1);
	Tools* t = App::getTools();
	t->AddTool(tool);
	lua_pop(L, 1);
	return 0;
}
开发者ID:sunxfancy,项目名称:artist,代码行数:7,代码来源:artistlib.cpp


示例3: Tools

vector<lObjType> * Domain::getConstant(){
	Tools tools = Tools();
	vector<lObjType> * ret = new vector<lObjType>();
	vector<Type*>* types_obj,temp2;
	bool marq;
	lObjType temp;
	for (vector<Constant *>::iterator it_const=m_constants->begin(); it_const != m_constants->end() ; ++it_const){//each constant
		types_obj= (*it_const)->getTypes();
		if ( ret->size() != 0){
			marq=true;
			for(vector<lObjType>::iterator it_ret = ret->begin() ;  it_ret != ret->end() ; ++it_ret){
				temp2 =(*it_ret).getType();
				if (tools.compareVectorType(&temp2,types_obj)){
					(*it_ret).addObject( new Object( (*it_const)->getName(),*(*it_const)->getTypes() ));
					marq=false;
				} 
			}
			if(marq) {
				temp = lObjType(*(types_obj));
				temp.addObject(new Object((*it_const)->getName(),*((*it_const)->getTypes())));
				ret->push_back(temp);
			}
		} else {
			temp = lObjType(*(types_obj));
			temp.addObject(new Object((*it_const)->getName(),*((*it_const)->getTypes())));
			ret->push_back(temp);
		}
	}
	return ret;		
}
开发者ID:nathanprat,项目名称:tlp-gp,代码行数:30,代码来源:domain.cpp


示例4: toString

  Job JobFactory::createEnergyPlusJob(
      ToolInfo t_energyPlusTool,
      const openstudio::path &t_idd,
      const openstudio::path &t_idf,
      const openstudio::path &t_epw,
      const openstudio::path &t_outdir,
      const boost::optional<openstudio::UUID> &t_uuid)
  {
    JobParams params;
    params.append("outdir", toString(t_outdir));

    Tools tools;
    t_energyPlusTool.name = "energyplus";
    tools.append(t_energyPlusTool);

    Files files;
    FileInfo idf(t_idf, "idf");

    if (!t_idd.empty())
    {
      idf.addRequiredFile(t_idd,toPath("Energy+.idd"));
    }

    idf.addRequiredFile(t_epw, toPath("in.epw"));
    files.append(idf);

    return createEnergyPlusJob(tools, params, files, std::vector<openstudio::URLSearchPath>(), t_uuid);
  }
开发者ID:airguider,项目名称:OpenStudio,代码行数:28,代码来源:JobFactory.cpp


示例5: main

int main(int argc, const char * argv[]) {
    std::string path = "/Users/JamesGuo/git_master/Algorithms/kargerMinCut.txt";
    std::vector<std::vector<int>> graph;
    int row, column;
    size_t minimum = 19900;
    Tools tool;
    graph = tool.readTxt(path);
    for (size_t i = 0; i < 80000; i++) {
        srand((unsigned int)time(NULL));
        uGraph undirectedGraph(graph, 200);
        while (undirectedGraph.nbVertices > 2) {
            row = rand() % undirectedGraph.adjacencyList.size();
            column = rand() % undirectedGraph.adjacencyList[row].size();
            if (column == 0) {
                column = 1;
            }
            undirectedGraph.Contraction(row, column);
            //std::cout << undirectedGraph.nbVertices << std::endl;
        }
        if (minimum > undirectedGraph.minCut()) {
            minimum = undirectedGraph.minCut();
        }
        //std::cout << i << std::endl;
    }
    std::cout << minimum << std::endl;
    return 0;
}
开发者ID:jamesguoxin,项目名称:Algorithms,代码行数:27,代码来源:main.cpp


示例6: TEST_F

TEST_F(RunManagerTestFixture, Workflow_ToWorkItems)
{
  ToolInfo ti("tool", openstudio::toPath("somepath"));
  Tools tis;
  tis.append(ti);

  JobParam param("param1");
  JobParams params;
  params.append(param);

  FileInfo fi(openstudio::toPath("somefile.txt"), "txt");
  Files fis;
  fis.append(fi);

  Workflow wf("null->energyplus");
  wf.add(params);
  wf.add(tis);
  wf.add(fis);

  std::vector<WorkItem> wis = wf.toWorkItems();

  ASSERT_EQ(2u, wis.size());
  EXPECT_EQ(JobType(JobType::Null), wis[0].type);
  EXPECT_EQ(JobType(JobType::EnergyPlus), wis[1].type);

  EXPECT_EQ(params, wis[0].params);
  EXPECT_EQ(fis, wis[0].files);
  EXPECT_EQ(tis, wis[0].tools);

  EXPECT_TRUE(wis[1].params.params().empty());
  EXPECT_TRUE(wis[1].files.files().empty());
  EXPECT_TRUE(wis[1].tools.tools().empty());
} 
开发者ID:jtanaa,项目名称:OpenStudio,代码行数:33,代码来源:Workflow_GTest.cpp


示例7: AddToolFromJson

static int AddToolFromJson(lua_State *L) {
	const char* json_path = lua_tostring(L,-1);
	Tools* t = App::getTools();
	t->AddToolFromJson(json_path);
	lua_pop(L,1);
	return 0;
}
开发者ID:sunxfancy,项目名称:artist,代码行数:7,代码来源:artistlib.cpp


示例8: UnActiveTool

static int UnActiveTool(lua_State *L) {
	const char* name = lua_tostring(L,-1);
	Tools* t = App::getTools();
	t->UnActive(name);
	lua_pop(L,1);
	return 0;
}
开发者ID:sunxfancy,项目名称:artist,代码行数:7,代码来源:artistlib.cpp


示例9: plotFTE

//----------------------------------------//
// Vector potential plots
//----------------------------------------//
void plotFTE(vector<TString> fnames, 
	     vector<TString> lnames,
	     vector<float> scales)
{

  // Hist attributes
  TString xtitle = "frequency [Hz]";
  TString ytitle = "Arbitrary Units";
  float xmin = 1e8;
  float xmax = 3e9;
  TString savename = "FTE";

  // Get Tool for FT
  Tools* fttool = new Tools();

  // Load the histograms that are of interest
  vector<TH1F*> hists;
  for(unsigned int i=0; i<fnames.size(); ++i){
    TFile* file  = new TFile(fnames.at(i));
    TH1F* E_td   = SummaryZ->getE(0);
    TH1F* E_fd   = fttool->getFTFD(E_td);
    hists.push_back( E_fd );
    hists.back()->SetDirectory(0);
    setHistAtt(hists.back(), xtitle, ytitle, m_colors[i], m_markers[i]);
    hists.back()->Scale(scales.at(i));
    hists.back()->SetLineWidth(2);
    file->Close();
  }// end loading of histograms
  
  plot(hists, lnames, savename, xmin, xmax, true, true);

}
开发者ID:mrelich,项目名称:IceBlockAna,代码行数:35,代码来源:WidthComparison.C


示例10: TEST_F

TEST_F(RunManagerTestFixture, ConfigOptionsTest)
{
  using namespace openstudio;
  using namespace openstudio::runmanager;

  ConfigOptions co;

  co.reset();

  ToolVersion e1(5,4,2);
  ToolVersion e2(3,2,1);
  ToolVersion e3(3,1,2);
  ToolVersion e4(2,7);
  ToolVersion e5(2,7,1);
  ToolVersion e6(2);
  ToolVersion e7(8,4,2,"TAG");

  ToolLocationInfo p1 = ToolLocationInfo(ToolType("EnergyPlus"), toPath("e1"));
  ToolLocationInfo p2 = ToolLocationInfo(ToolType("EnergyPlus"), toPath("e2"));
  ToolLocationInfo p3 = ToolLocationInfo(ToolType("EnergyPlus"), toPath("e3"));
  ToolLocationInfo p4 = ToolLocationInfo(ToolType("EnergyPlus"), toPath("e4"));
  ToolLocationInfo p5 = ToolLocationInfo(ToolType("EnergyPlus"), toPath("e5"));
  ToolLocationInfo p6 = ToolLocationInfo(ToolType("EnergyPlus"), toPath("e6"));
  ToolLocationInfo p7 = ToolLocationInfo(ToolType("EnergyPlus"), toPath("e7"));

  co.setToolLocation(e6, p6);
  co.setToolLocation(e5, p5);
  co.setToolLocation(e3, p3);
  co.setToolLocation(e1, p1);
  co.setToolLocation(e4, p4);
  co.setToolLocation(e2, p2);
  co.setToolLocation(e7, p7);


  // getEnergyPlus returns the most completely specified version of E+ that matches the passed
  // in requirements

  EXPECT_EQ(static_cast<size_t>(7), co.getToolLocations().size());

  Tools tools = co.getTools();

  EXPECT_EQ(tools.getTool("energyplus").version, e7);
  EXPECT_EQ(tools.getTool("energyplus", e3).version, e3);
  EXPECT_EQ(tools.getTool("energyplus", ToolVersion(3)).version, e2);
  EXPECT_EQ(tools.getTool("energyplus", ToolVersion(3, 2)).version, e2);
  EXPECT_EQ(tools.getTool("energyplus", ToolVersion(3, 1)).version, e3);
  EXPECT_EQ(tools.getTool("energyplus", ToolVersion(2)).version, e5);
  EXPECT_EQ(tools.getTool("energyplus", ToolVersion(8)).version, e7);
  EXPECT_EQ(tools.getTool("energyplus", ToolVersion(8,4)).version, e7);
  EXPECT_EQ(tools.getTool("energyplus", ToolVersion(8,4,2)).version, e7);
  EXPECT_EQ(tools.getTool("energyplus", ToolVersion(8,4,2, "TAG")).version, e7);
  EXPECT_EQ(tools.getTool("energyplus", ToolVersion(boost::none,boost::none,boost::none,boost::optional<std::string>("TAG"))).version, e7);

  co.reset();

  EXPECT_EQ(co.getToolLocations().size(), static_cast<size_t>(0));
}
开发者ID:Anto-F,项目名称:OpenStudio,代码行数:57,代码来源:ConfigOptions_GTest.cpp


示例11: new

Tools* Tools::create(WJLayerJson *layer, Snowman *snowman)
{
	Tools* deco = new (std::nothrow) Tools();
	if (deco && deco->init(layer, snowman))
	{
		deco->autorelease();
		return deco;
	}

	CC_SAFE_DELETE(deco);

	return NULL;
}
开发者ID:dalechngame,项目名称:mygame,代码行数:13,代码来源:Tools.cpp


示例12: AddToolFromLua

static int AddToolFromLua(lua_State *L) {
	const char* name    = lua_tostring(L,-4);
	const char* click   = lua_tostring(L,-3);
	const char* release = lua_tostring(L,-2);
	const char* move    = lua_tostring(L,-1);
	LuaTool* tool = new LuaTool(name);
	tool->set_mouse_click_lua_funcname(click);
	tool->set_mouse_release_lua_funcname(release);
	tool->set_mouse_move_lua_funcname(move);
	lua_pop(L, 4);
	Tools* t = App::getTools();
	t->AddTool(tool);
	return 0;
}
开发者ID:sunxfancy,项目名称:artist,代码行数:14,代码来源:artistlib.cpp


示例13: TEST_F

TEST_F(RunManagerTestFixture, JSON_workItem)
{
  Tools tools;
  tools.tools().push_back(ToolInfo("tool", ToolVersion(1,5,6, "TAG"), 
        openstudio::toPath("path1"),
        boost::regex(".*")
        ));

  Files files;
  files.files().push_back(FileInfo("filename",
        openstudio::DateTime::now(),
        "key",
        openstudio::toPath("fullpath"),
        true));

  files.files()[0].addRequiredFile(QUrl("url"), openstudio::toPath("target"));

  JobParams params;
  params.append("key", "value");


  WorkItem wi(JobType::EnergyPlus,
      tools,
      params,
      files,
      "keyname");

  std::string json = wi.toJSON();

  EXPECT_FALSE(json.empty());

  openstudio::runmanager::WorkItem wi2 = WorkItem::fromJSON(json);

  EXPECT_EQ(wi2.type, JobType::EnergyPlus);
  EXPECT_EQ(wi2.tools, tools);
  EXPECT_EQ(wi2.params, params);
  EXPECT_EQ(wi2.files, files);
  EXPECT_EQ(wi2.jobkeyname, "keyname");


  std::string json2 = wi2.toJSON();

  EXPECT_EQ(json, json2);

}
开发者ID:MatthewSteen,项目名称:OpenStudio,代码行数:45,代码来源:JSON_GTest.cpp


示例14: project_verify

void project_verify(Project& project, Tools& tools)
{
#if 0
  for(Project::iterator i = project.begin(); i != project.end(); ++i)
  {
    Build& build = (*i).second;
    for(Build::iterator j = build.begin(); j != build.end(); ++j)
    {
      Tools::iterator k = tools.find((*j).first);
      if(k == g_build_tools.end())
      {
        build_error_undefined_tool((*i).first.c_str(), (*j).first.c_str());
      }
    }
  }
#endif
}
开发者ID:raynorpat,项目名称:cake,代码行数:17,代码来源:build.cpp


示例15: Tools

void GameAttributes::writeAttributes(std::ofstream *out)
{
	Tools t = Tools();
	*out << "INNINGS=" << innings << std::endl;
	*out << "EXTRAS=" << t.boolToString(extras) << std::endl; 
	*out << "BUNTING=" << t.boolToString(bunt) << std::endl;
	*out << "HBP=" << t.boolToString(hbp) << std::endl;
	*out << "STEALING=" << t.boolToString(stealing) << std::endl;
	*out << "BALKS=" << t.boolToString(balks) << std::endl;
	*out << "BALLS=" << startingBalls << std::endl;
	*out << "STRIKES=" << startingStrikes << std::endl;
	*out << "PLAYERS=" << players << std::endl;
	*out << "SUBS=" << subs << std::endl;
}
开发者ID:brianvanh,项目名称:baseball-scorebook,代码行数:14,代码来源:gameAttributes.cpp


示例16: createTools

void createTools(const std::vector<std::filesystem::path>& arguments, Tools& tools) {
	std::regex r("([^ ]+) *(.*)");
	for (const auto& arg: arguments) {
		std::smatch matches;
		if (std::regex_match(arg.native(), matches, r)) {
			fs::path path = std::filesystem::canonical(fs::path(matches[1]));
			if (!fs::is_regular_file(path)) {
				BENCHMAX_LOG_WARN("benchmax", "The tool " << path << " does not seem to be a file. We skip it.");
				continue;
			}
			const fs::perms executable = fs::perms::others_exec | fs::perms::group_exec | fs::perms::owner_exec;
			if ((fs::status(path).permissions() & executable) == fs::perms::none) {
				BENCHMAX_LOG_WARN("benchmax", "The tool " << path << " does not seem to be executable. We skip it.");
				continue;
			}
			BENCHMAX_LOG_DEBUG("benchmax.tools", "Adding tool " << path << " with arguments \"" << matches[2] << "\".");
			tools.emplace_back(std::make_unique<T>(path, matches[2]));
		}
	}
}
开发者ID:smtrat,项目名称:smtrat,代码行数:20,代码来源:Tools.cpp


示例17: SpectralAngleMatrix

int32_t SpectralAngleMatrix(char* filepath2,char* filepath3,char* logfilepath, vector<int> bandlist, string interkind, vector<double>& SpectralAngleMatrix) {
    GDALDataset *poDataset2,*poDataset3;
    GDALAllRegister();
    poDataset2=(GDALDataset *)GDALOpen(filepath2,GA_ReadOnly);
    poDataset3=(GDALDataset *)GDALOpen(filepath3,GA_ReadOnly);
    if( (poDataset2 == NULL) || (poDataset3 == NULL)  ) {
        WriteMsg(logfilepath,-1,"Image file open error!");
        GDALClose(poDataset2);
        poDataset2=NULL;
        GDALClose(poDataset3);
        poDataset3=NULL;
        return -1;
    } else {
        WriteMsg(logfilepath,0,"SpectralAngleMatrix algorithm is executing!");
    }

    int32_t n,i,j;
    int32_t width2,height2;
    int32_t bandnum3,width3,height3;

    width2=poDataset2->GetRasterXSize();
    height2=poDataset2->GetRasterYSize();

    bandnum3=poDataset3->GetRasterCount();
    width3=poDataset3->GetRasterXSize();
    height3=poDataset3->GetRasterYSize();

    if(bandlist.size() != bandnum3) {
        GDALClose(poDataset2);
        poDataset2=NULL;
        GDALClose(poDataset3);
        poDataset3=NULL;
        WriteMsg(logfilepath, -1, "bandlist.size() != bandnum3 || width2 != width3 || height2 != height3");
        return -1;
    }
    GDALRasterBand *pband;
    float *banddata2,*banddata3;
    float *tempdata1,*tempdata2,*tempdata3;
    banddata2=(float*)CPLMalloc(sizeof(float)*width2*height2);
    banddata3=(float*)CPLMalloc(sizeof(float)*width3*height3);
    tempdata1=(float *)CPLMalloc(sizeof(float)*width3*height3);
    tempdata2=(float *)CPLMalloc(sizeof(float)*width3*height3);
    tempdata3=(float *)CPLMalloc(sizeof(float)*width3*height3);

    float* new_data = (float*)malloc(sizeof(float)*width3*height3);
    if(new_data == NULL) {
        GDALClose(poDataset2);
        poDataset2=NULL;
        GDALClose(poDataset3);
        poDataset3=NULL;
        WriteMsg(logfilepath, -1, "new_data malloc error !");
        return -1;
    }
    Tools obj;
    map<string, int> m_interalg;
    m_interalg["Nearest_1_0"]=1;
    m_interalg["Linear_1_0"]=2;
    m_interalg["CubicConv_1_0"]=3;

    for(n=0;n<bandnum3;n++) {
        pband=poDataset2->GetRasterBand(bandlist[n]);
        pband->RasterIO(GF_Read,0,0,width2,height2,banddata2,width2,height2,GDT_Float32,0,0);
        GDALClose(pband);
        pband=NULL;

        obj.Interpolation(banddata2,height2, width2, 1, new_data, height3, width3, m_interalg[interkind]);

        pband=poDataset3->GetRasterBand(n+1);
        pband->RasterIO(GF_Read,0,0,width3,height3,banddata3,width3,height3,GDT_Float32,0,0);
        GDALClose(pband);
        pband=NULL;

        int32_t tempnum2=0;
        int32_t tempnum3=0;

        for(i=0;i<height3;i++) {
            for(j=0;j<width3;j++) {
                if(n==0) {
                    tempdata1[i*width3+j]=0.0;
                    tempdata2[i*width3+j]=0.0;
                    tempdata3[i*width3+j]=0.0;
                }

                tempnum2=new_data[i*width2+j];
                tempnum3=banddata3[i*width3+j];
                if(tempnum2>0 && tempnum3>0) {
                    tempdata1[i*width3+j]=tempdata1[i*width3+j]+(1.0*tempnum2*tempnum3/bandnum3);
                    tempdata2[i*width3+j]=tempdata2[i*width3+j]+(1.0*tempnum2*tempnum2/bandnum3);
                    tempdata3[i*width3+j]=tempdata3[i*width3+j]+(1.0*tempnum3*tempnum3/bandnum3);
                }
            }
        }

        int32_t temp = (int)(100.0*(n+1)/bandnum3);
        temp = (temp>99) ? 99:temp;
        WriteMsg(logfilepath,temp,"SpectralAngleMatrix algorithm is executing!");
    }

    free(new_data);
    CPLFree(banddata2);
//.........这里部分代码省略.........
开发者ID:DengZhuangSouthRd,项目名称:FusionServer,代码行数:101,代码来源:spectralanglematrix.cpp


示例18: main

bool main() //bool main is so true
{
	bool isGenerateRand = false, isFullscreen = true, isNotMuted = true, isStuSound = true, isSpecialCase = false, isDummy = true;
	string songname = "sounds/1.ogg";
	string  temp, truefalse, ID, password, inputID, inputPassword, name, multi;
	string emptyy;
	string intro = "Can you type? If not please use the Windows Speech Recogniser\nthen say \"type N\" and then say \"Enter\" before using the program.\n";
	Tools tool;
	TF tf;
	Multiple mul;
	

	system("color 3f");

	cout << intro;
	speak(intro,8500);
	cin >> emptyy;
	if (emptyy == "no" || emptyy == "No" || emptyy == "NO" || emptyy == "n" || emptyy == "N") 
	{
			isSpecialCase = true;
			isStuSound = false;
			cout << "Microsoft's commands like: \"Type (Letter)\".\nMy Voice Commands in the Student's GUI: \n\"True\" \n\"False\" \n\"A\" \n\"B\" \n\"C\" \n\"Switch/Change\" \n\"Leave\": Leave the exam before finishing it. \n\"Quit\"\n";
			speak("Press any button to continue", 1700);
			system("PAUSE");
	}
	else isSpecialCase = false;

	initializeAgain:
	tool.initialize();
	//tool.resetQuestions();	//use those for emergency
	//	tool.resetAll();
	bool isDone = false, isStudent = false, isInstructor = false, isAdmin = false, isHelp = false, isExam = false, isScore = false, isShot = false, isOptions = false, qanswer;

	short numStudents = tool.recieveFromInt("database/numStudents.txt");
	short numInstructors = tool.recieveFromInt("database/numInstructor.txt");
	short numTF = tool.recieveFromInt("database/numTF.txt");
	short numMUL = tool.recieveFromInt("database/numMUL.txt");
	short numGrades = tool.recieveFromInt("database/numGrades.txt");
	short numExamTakers = tool.recieveFromInt("database/numExamTakers.txt");
	short qgrade, qpenalty, numANS = 20, size = 0, rightAns = 0, maxTF = numTF, maxMUL = numMUL, picChanger = 0, MrBreaker = 0, specialNum = 0, color1 = 0, color2 = 0, color3 = 0; //leave size alone
	short tempo = 0;

	float x = 0.0, y = 0.0, newX = 0.0, newY = 0.0 ;

	emptyy = "";

	if (numTF < 0) numTF = 0;
	if (numMUL < 0) numMUL = 0;
	if (numStudents < 0) numStudents = 0;
	//containers for questions and students_________________

	string mulAnsTemp[3];
	string tempname;
	string *TFarr = new string[numTF];
	string *MULarr = new string[numMUL];
	string *mulAns = new string[numMUL * 3];

	TF *TrueFalseArr = new TF[numTF],the_TFQuestion;
	Multiple *MultipleArr = new Multiple[numMUL],the_MULQuestion;
	Student tempStu;
	
	//containers for questions and students_________________


	//TF____________________________________________________

	if (numTF > 1) 
	{
		ifstream fromTF("database/TFnumbers.txt");
		tool.recieveQtext("database/TF.txt", TFarr,numTF);
		
		for (short i = 0; i < numTF; i++) 
		{
			fromTF >> qgrade >> qpenalty >> qanswer;
			if (TFarr[i] != "") 
			{
				TrueFalseArr[tempo].newQuestionTF(TFarr[i], qgrade, qpenalty, qanswer);
				++tempo;
			}
		}
		fromTF.close();
	}
开发者ID:ddevelhanter,项目名称:ReworkedProjectExamSystem,代码行数:82,代码来源:main.cpp


示例19: CC_BREAK_IF

// on "init" you need to initialize your instance
bool LayerLoading::init()
{
    bool bRet = false;
    do 
    {
		CCEGLView::sharedOpenGLView()->setDesignResolutionSize(1024, 576, kResolutionShowAll);

		m_nNumberOfLoadedSprites=0;

        //////////////////////////////////////////////////////////////////////////
        // super init first
        //////////////////////////////////////////////////////////////////////////
        CC_BREAK_IF(! CCLayer::init());

		CCSize s = CCDirector::sharedDirector()->getWinSize();

        // Add a label
		pLabel = CCLabelTTF::create("Loading...", "Arial", 24);
        CC_BREAK_IF(! pLabel);
        pLabel->setPosition(ccp(s.width / 2, s.height * 0.15f));
        this->addChild(pLabel, 1);

        // 3. Add add a splash screen, show the cocos2d splash image.
        CCSprite* pSprite = CCSprite::create("scene_loading_bg.png");
        CC_BREAK_IF(! pSprite);
        pSprite->setPosition(ccp(s.width/2, s.height/2));
        this->addChild(pSprite, 0);
		pSprite->setScaleX(s.width / pSprite->getContentSize().width);
		pSprite->setScaleY(s.height/ pSprite->getContentSize().height);

        
		char temp[32]; //注意不要越界
		for(int i =1;i<14;i++){
			sprintf(temp,"card_clubs_%d.png",i);
			CCTextureCache::sharedTextureCache()->addImageAsync(temp, this, callfuncO_selector(LayerLoading::loadingCallBack));
		}
		for(int i =1;i<14;i++){
			sprintf(temp,"card_diamonds_%d.png",i);
			CCTextureCache::sharedTextureCache()->addImageAsync(temp, this, callfuncO_selector(LayerLoading::loadingCallBack));
		}
		for(int i =1;i<14;i++){
			sprintf(temp,"card_hearts_%d.png",i);
			CCTextureCache::sharedTextureCache()->addImageAsync(temp, this, callfuncO_selector(LayerLoading::loadingCallBack));
		}
		for(int i =1;i<14;i++){
			sprintf(temp,"card_spades_%d.png",i);
			CCTextureCache::sharedTextureCache()->addImageAsync(temp, this, callfuncO_selector(LayerLoading::loadingCallBack));
		}
		
        CCTextureCache::sharedTextureCache()->addImageAsync("scene_game_bg_desk.png", this, callfuncO_selector(LayerLoading::loadingCallBack));
        CCTextureCache::sharedTextureCache()->addImageAsync("scene_welcome_logo.png", this, callfuncO_selector(LayerLoading::loadingCallBack));
        CCTextureCache::sharedTextureCache()->addImageAsync("scene_welcome_info_bg.png", this, callfuncO_selector(LayerLoading::loadingCallBack));
        CCTextureCache::sharedTextureCache()->addImageAsync("scene_welcome_bg.png", this, callfuncO_selector(LayerLoading::loadingCallBack));
        
		CCSprite *m_loading_0 =CCSprite::create("scene_loading_0.png");
		addChild(m_loading_0);
		m_loading_0->setAnchorPoint(ccp(0.5f,0.5f));
		m_loading_0->setPosition(ccp(s.width/2, s.height/2));

		m_loading_bar = CCProgressTimer::create(CCSprite::create("scene_loading_100.png"));
		m_loading_bar->setType(kCCProgressTimerTypeBar);
		m_loading_bar->setMidpoint(ccp(0,0));
		m_loading_bar->setBarChangeRate(ccp(0, 1));
		addChild(m_loading_bar);
		m_loading_bar->setAnchorPoint(ccp(0.5f,0.5f));
		m_loading_bar->setPosition(ccp(s.width/2, s.height/2));

//        CCProgressTo *to = CCProgressTo::create(2,100);
//        CCFiniteTimeAction* fn = CCCallFunc::create(this,callfunc_selector(LayerLoading::enterSceneWelcome));
//        CCActionInterval* seq =  CCSequence::create(to,fn,NULL);
//        
//        m_loading_bar->runAction(seq);
        
		//合法性检查,注意调用顺序
		Tools* tools =Tools::sharedTools();	
		tools->updateRooted();
		tools->checkEncryptionAll(this);

       bRet = true;
    } while (0);

    return bRet;
}
开发者ID:mrktj,项目名称:OX-poker-good-cocos2dx2.2.5,代码行数:84,代码来源:SceneLoading.cpp


示例20: qMakePair

QPair<double, double> SphereProjector::computeSphericalCoordinates(QVector3D vector){
    auto x = vector.x();
    auto y = vector.y();
    auto z = vector.z();
    auto theta = std::acos(y / sqrt(sqr(x) + sqr(y) + sqr(z)));
    auto phi = std::atan2(z, x);
    return qMakePair(theta, phi);
}
开发者ID:sirgl,项目名称:CG_labs,代码行数:8,代码来源:SphereProjector.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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