示例#1
0
	void OnCopyClick(wxCommandEvent&)
	{
		wxString gdbname, exepath, corepath;
		gdbname = m_gdb->GetValue();
		exepath = m_img->GetValue();
		corepath = m_corefile->GetValue();
		if (gdbname.length()>0 && corepath.length()>0 && exepath.length()==0)
			return FindExectuable(corepath);
		if (gdbname.length() > 0 && corepath.length() > 0
				&& exepath.length() > 0) {
			wxString txtfile(&_binary_gdbcmd_txt_start,
					(int) &_binary_gdbcmd_txt_size);
			wxString cmdpattern;
			cmdpattern.Printf(txtfile, gdbname, exepath, corepath);
			m_coreinfo->SetValue(cmdpattern);
			m_coreinfo->SetValue(exec_cmd(cmdpattern.c_str()));
		}
//		cmdpattern.Printf(m_coreinfo->GetValue(), )
//		wxClipboard cb;
//		if(cb.Open()){
//			cb.Clear();
//		cb.SetData(new wxTextDataObject(m_coreinfo->GetValue()));
//		cb.Flush();
//		cb.Close();
//		}
	}
//生成点云,ply格式,txt格式,带误差的txt格式
void StereoReconstructor::plyFileGenerate(std::vector<RestructPoint> pointCloud,	//3d点云
                                          std::string ply,				//ply文件
                                          std::string txtFile,		//带误差的txt文件
                                          std::string points)				//txt文件
{
  std::ofstream cloud(ply);
  std::ofstream txtfile(txtFile);
  std::ofstream d3file(points);

  //头
  cloud << "ply" << std::endl;
  cloud << "format ascii 1.0" << std::endl;
  cloud << "element vertex " << pointCloud.size() << std::endl;
  cloud << "property float x" << std::endl;
  cloud << "property float y" << std::endl;
  cloud << "property float z" << std::endl;
  cloud << "end_header" << std::endl;

  //顶点
  for (int i = 0; i < pointCloud.size(); i++) {
    cloud << pointCloud[i].point.x << " " << pointCloud[i].point.y << " " << pointCloud[i].point.z << std::endl;
    txtfile << pointCloud[i].point.x << " " << pointCloud[i].point.y << " " << pointCloud[i].point.z << " " << pointCloud[i].distance << std::endl;
    d3file << pointCloud[i].point.x << " " << pointCloud[i].point.y << " " << pointCloud[i].point.z << std::endl;
  }

  cloud.close();
  txtfile.close();
  d3file.close();
}
示例#3
0
	void reset()
	{
		m_gdb->SetValue(wxT("arm-marvell-linux-gnueabi-gdb"));
		m_corefile->SetValue(wxEmptyString);
		m_img->SetValue(wxEmptyString);
		wxString txtfile(&_binary_gdbcmd_txt_start, (int)&_binary_gdbcmd_txt_size);
			m_coreinfo->SetValue(txtfile);
	}
示例#4
0
CPLErr Txt2Any(const char * txt, const char * shp, Option opt)
{
	Txt txtfile(txt, opt);
	std::list<Point> ring = txtfile.getRing();

	auto geo = GeometryFromRing(ring);

	Any shpfile(shp, opt);
	shpfile.AddGeometry(geo);

	return CE_None;
}
示例#5
0
文件: setting.cpp 项目: rd8/qGo
void Setting::saveSettings()
{
//	if (readBoolEntry("REM_FONT"))
//	{
	// add fonts and colors
	writeEntry("FONT_MAIN", fontToString(fontStandard));
	writeEntry("FONT_MARK", fontToString(fontMarks));
	writeEntry("FONT_COMMENT", fontToString(fontComments));
	writeEntry("FONT_LIST", fontToString(fontLists));
	writeEntry("FONT_CLOCK", fontToString(fontClocks));
	writeEntry("FONT_CONSOLE", fontToString(fontConsole));

	QString cs = "";

	cs += QChar(charset->blackStone);
	cs += QChar(charset->emptyPoint);
	cs += QChar(charset->hBorder);
	cs += QChar(charset->starPoint);
	cs += QChar(charset->vBorder);
	cs += QChar(charset->whiteStone);
    
	writeEntry("CHARSET", cs);

	writeEntry("COLOR_BK", colorBackground.name());
	writeEntry("COLOR_ALT_BK", colorAltBackground.name());

	writeIntEntry("VERSION", SETTING_VERSION);

	list.sort();

	QFile file(settingHomeDir + "/." + PACKAGE + "rc");
    
	if (file.open(IO_WriteOnly))
	{
		QTextStream txtfile(&file);

		// write list to file: KEY [TXT]
		Parameter *par;
		for (par = list.first(); par != 0; par = list.next())
			if (!par->txt().isEmpty() && !par->txt().isNull())
				txtfile << par->key() << " [" << par->txt() << "]" << endl;

		file.close();
	}
}