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


C++ Array::GetEntry方法代码示例

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


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

示例1: Draw

/* draw route on the map */
void GPXRoute::Draw(kGUICorners *c)
{
	unsigned int i;
	GPXRouteEntry *re;
	kGUIColor col;
	kGUIColor col2;
	int px,py,lpx=0,lpy=0;
	GPXRow *row;

	/* todo, bounding box for route, compare against the corners */

	col=GPX::GetTableColor(GetColorIndex());
	col2=GPX::GetTableTColor(GetColorIndex());

	for(i=0;i<m_numentries;++i)
	{
		re=m_entries.GetEntry(i);
		row=gpx->Locate(&re->m_wptname);
		if(!row)
			return;	/* error, missing waypoint in track!!! */
		gpx->m_curmap->ToMap(row->GetCoord(),&px,&py);
		px-=c->lx;
		py-=c->ty;
		if(i)
			GPXRoute::DrawLine(i,px,py,lpx,lpy,col);
		lpx=px;
		lpy=py;
	}
}
开发者ID:neolu,项目名称:gpsturbo,代码行数:30,代码来源:routes.cpp

示例2: Save

void GPXRoute::Save(kGUITableObj *table,kGUITickBoxObj *draw,kGUIComboBoxObj *color)
{
	unsigned int e;
	unsigned int nr;
	kGUIObj *obj;
	GPXRow *row;
	GPXRouteEntry *re;

	/* delete old entries if there are any? */
	for(e=0;e<m_numentries;++e)
		delete m_entries.GetEntry(e);

	SetDraw(draw->GetSelected());
	SetColorIndex(color->GetSelection());

	nr=table->GetNumChildren(0);
	/* number of valid entries */
	m_numentries=nr;
	m_entries.Alloc(nr);
	for(e=0;e<nr;++e)
	{
		obj=table->GetChild(e);
		row=static_cast<GPXRow *>(obj);
		re=new GPXRouteEntry();
		re->m_wptname.SetString(row->GetWptName());
		m_entries.SetEntry(e,re);
	}
}
开发者ID:neolu,项目名称:gpsturbo,代码行数:28,代码来源:routes.cpp

示例3: Compare

bool GPXRoute::Compare(kGUITableObj *table,kGUITickBoxObj *draw,kGUIComboBoxObj *color)
{
	unsigned int e;
	kGUIObj *obj;
	GPXRow *row;
	GPXRouteEntry *re;

	if(table->GetNumChildren(0)!=m_numentries)
		return(true);

	/* draw flag has changed */
	if(draw->GetSelected()!=GetDraw())
		return(true);

	/* color has changed? */
	if((unsigned int)color->GetSelection()!=GetColorIndex())
		return(true);

	for(e=0;e<m_numentries;++e)
	{
		re=m_entries.GetEntry(e);	/* route record */
		obj=table->GetChild(e);
		row=static_cast<GPXRow *>(obj);

		if(strcmp(row->GetWptName(),re->m_wptname.GetString()))
			return(true);
	}
	return(false);	/* same! */
}
开发者ID:neolu,项目名称:gpsturbo,代码行数:29,代码来源:routes.cpp

示例4: Update

void AutoOrderWindow::Update(void)
{
	unsigned int newcount;
	unsigned int newbest;

	m_busyrect.Animate();
	newcount=m_tsp.GetCount();
	if(newcount!=m_count)
	{
		m_count=newcount;
		m_tries.Sprintf("Tries: %d",m_count);

		newbest=m_tsp.GetNewBest();
		if(newbest!=m_curbest)
		{
			unsigned int f;
			unsigned int s;
			unsigned int nc=m_t->GetNumChildren();
			int *curlist=m_tsp.GetCurList();
			double dist=0.0f,ratio,eval1,eval2;
			GPXRow *lrow;
			GPXRow *row;

			/* generate results report */
			GPX::GetDistInfo(gpx->GetCurrentDist(),0,&ratio,&eval1,&eval2);

			s=0;
			while(curlist[s])
				++s;
			lrow=0;
			for(f=0;f<nc;++f)
			{
				row=m_rows.GetEntry(curlist[s]);
				if(lrow)
					dist+=(lrow->GetCoord()->Dist(row->GetCoord())*ratio);
				lrow=row;
				if(++s==nc)
					s=0;
			}
			if(dist<m_startdist)
				m_best.Sprintf("Distance: %.2f",dist);
		}
	}
}
开发者ID:neolu,项目名称:gpsturbo,代码行数:44,代码来源:routes.cpp

示例5: Load

void GPXRoute::Load(kGUITableObj *table,kGUITickBoxObj *draw,kGUIComboBoxObj *color)
{
	unsigned int e;
	GPXRow *row;
	GPXRow *fullrow;
	GPXRouteEntry *re;

	draw->SetSelected(GetDraw());
	color->SetSelectionz(GetColorIndex());

	table->DeleteChildren();
	for(e=0;e<m_numentries;++e)
	{
		re=m_entries.GetEntry(e);	/* route record */
		fullrow=gpx->Locate(&re->m_wptname);
		if(fullrow)
		{
			row=new GPXRow();	/* copy record from full table */
			row->Copy(fullrow);
			table->AddRow(row);
		}
	}
}
开发者ID:neolu,项目名称:gpsturbo,代码行数:23,代码来源:routes.cpp


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