本文整理汇总了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;
}
}
示例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);
}
}
示例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! */
}
示例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);
}
}
}
示例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);
}
}
}