您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ FindPath函数代码示例

51自学网 2021-06-01 20:46:57
  C++
这篇教程C++ FindPath函数代码示例写得很实用,希望能帮到您。

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

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

示例1: OpenFile

CString XMLSerialized::LoadInfo(const CString& sName,TagType tagType,const CString parent=L""){	CMarkup xml = OpenFile();		if(tagType== TagType::Element){		if(FindPath(sName,&xml))			return xml.GetData();	}	if(tagType== TagType::Attribute){		if(FindPath(parent,&xml))			return xml.GetAttrib(sName);	}	return L"";}
开发者ID:zidane168,项目名称:AutoPlay,代码行数:13,


示例2: _tmain

int _tmain(int argc, _TCHAR* argv[]){	unsigned char pMap[] = { 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1 };	int pOutBuffer[12];	const int result1 = FindPath(0, 0, 1, 2, pMap, 4, 3, pOutBuffer, 12);	Output(pOutBuffer, result1);	unsigned char pMap2[] = { 0, 0, 1, 0, 1, 1, 1, 0, 1 };	int pOutBuffer2[7];	const int result2 = FindPath(2, 0, 0, 2, pMap2, 3, 3, pOutBuffer2, 7);	Output(pOutBuffer, result2);	system("PAUSE");	return 0;}
开发者ID:zimzimdz,项目名称:AStar_FlatMap,代码行数:15,


示例3: startPos

bool NavGrid::FindPath(const CU::Vector3f& aStartPoint, const CU::Vector3f& aEndPoint, CU::GrowingArray<CU::Vector2f>& aOutPath){	CU::Vector2i startPos(static_cast<int>(aStartPoint.x), static_cast<int>(aStartPoint.z));	CU::Vector2i endPos(static_cast<int>(aEndPoint.x), static_cast<int>(aEndPoint.z));	return FindPath(startPos, endPos, aOutPath);}
开发者ID:nian0601,项目名称:MagmaEngine,代码行数:7,


示例4: TestSparsePerformance

void TestSparsePerformance(bool outputMap){	int cellSize = 16;	int w = 40;	int h = 100;	double map = CreateSparseMap(w*cellSize,h*cellSize,cellSize);	//map = CreateMap(w*cellSize,h*cellSize,cellSize);	SetCellMap(map, 4*cellSize, 4*cellSize, 1);	SetCellMap(map, 5*cellSize, 4*cellSize, 1);	SetCellMap(map, 5*cellSize, 5*cellSize, 1);	SetCellMap(map, 5*cellSize, 6*cellSize, 1);	SetCellMap(map, 5*cellSize, 7*cellSize, 1);	SetCellMap(map, 4*cellSize, 7*cellSize, 1);	SetCellMapRegion(map, (w/2)*cellSize, 0*cellSize, 2*cellSize, (h*0.75)*cellSize, 1);	//SetCellMapRegion(map, (w/2)*cellSize, (h/2+1)*cellSize, 2*cellSize, (h/2-2)*cellSize, 1);#ifndef _DEBUG	double pathFinder = CreatePathFinder(map);#else	double mapDebug = CreateMap(w*cellSize,h*cellSize,cellSize);	double pathFinder = CreatePathFinderDebug(map, mapDebug);#endif		double path = FindPath(pathFinder, 2.0*cellSize, 8.0*cellSize, (w-2)*cellSize, 2.0*cellSize);	if (outputMap)	{		OutputPath(map, path);	}	DestroyMap(map);	DestroyPathFinder(pathFinder);	DestroyPath(path);#ifdef _DEBUG	DestroyMap(mapDebug);#endif}
开发者ID:suilevap,项目名称:motion-plan,代码行数:35,


示例5: ComputeDir

void CRole::SetDst(Pos pos){	m_bBeginFindPath = false;	m_fdst = m_dst = pos;	ComputeDir();	int x = (int)(m_fdst.x/m_pMap->m_tileWidth);	int y = (int)(m_fdst.y/m_pMap->m_tileHeight);	if(!m_pMap->Passable(x, y))//如果目标不可到达	{		int bestx;int besty;		m_bestPosFinder->FindBestPos(x, y, &bestx, &besty, m_pMap->m_map);//寻找最近可走点		m_fdst.x = (float)bestx*m_pMap->m_tileWidth;		m_fdst.y = (float)besty*m_pMap->m_tileHeight;		//printf("%d %d/n", bestx, besty);	}	ClearPath();	//int t=timeGetTime(); //计算寻路时间	FindPath(&m_pos, &m_fdst);	//printf("寻路消耗时间: %d/n",timeGetTime()-t); //	if(GetNextPos(&m_dst, 			(float)m_pMap->m_tileWidth/2, (float)m_pMap->m_tileHeight/2))	ComputeDir();	else		SetStop();}
开发者ID:fg5823820,项目名称:HGEGameDemo2,代码行数:27,


示例6: FindPath

void Operator::CalcPEC_Curves(){	//special treatment for primitives of type curve (treated as wires)	double p1[3];	double p2[3];	struct Grid_Path path;	vector<CSProperties*> vec_prop = CSX->GetPropertyByType(CSProperties::METAL);	for (size_t p=0; p<vec_prop.size(); ++p)	{		CSProperties* prop = vec_prop.at(p);		for (size_t n=0; n<prop->GetQtyPrimitives(); ++n)		{			CSPrimitives* prim = prop->GetPrimitive(n);			CSPrimCurve* curv = prim->ToCurve();			if (curv)			{				for (size_t i=1; i<curv->GetNumberOfPoints(); ++i)				{					curv->GetPoint(i-1,p1);					curv->GetPoint(i,p2);					path = FindPath(p1,p2);					if (path.dir.size()>0)						prim->SetPrimitiveUsed(true);					for (size_t t=0; t<path.dir.size(); ++t)					{						SetVV(path.dir.at(t),path.posPath[0].at(t),path.posPath[1].at(t),path.posPath[2].at(t), 0 );						SetVI(path.dir.at(t),path.posPath[0].at(t),path.posPath[1].at(t),path.posPath[2].at(t), 0 );						++m_Nr_PEC[path.dir.at(t)];					}				}			}		}	}}
开发者ID:ho-y,项目名称:openEMS,代码行数:34,


示例7: start

//移动地图到目的坐标,同可移动对象的移动类似void CGameMap::MoveTo(Point goal){    m_Paths.clear();    std::vector<Point>* Paths = &m_Paths;    Point start((int)m_CurrentXY.x, (int)m_CurrentXY.y);    FindPath(start, goal, Paths, m_pMapAstar);    //寻路失败,寻不到路或者寻路地址即为源地址    if(m_Paths.empty())    {        m_bArrived = true;    }    //寻路成功    else    {        //平滑路径        CActiveObject::SmoothPath(m_Paths, 50);        //当前Paths最后一个元素为当前位置        m_Paths.pop_back();        __Move1Step();        m_bArrived = false;    }}
开发者ID:xiaohuajiao,项目名称:Demo,代码行数:29,


示例8: KillLoop

	virtual void KillLoop(VertexId start, VertexId finish, const set<VertexId> &component) {		vector<EdgeId> path = FindPath(start, finish, component);		set<EdgeId> edges(path.begin(), path.end());		if(path.size() > 0 || start == finish) {//			if(start != finish || component.size() > 2)			if(/*!CheckStrong(component) || */!CheckNotMuchRemoved(edges, component)) {				return;			}/*			cout << this->g().int_id(start) << " " << this->g().int_id(finish) << endl;			cout << this->g().VertexNucls(start) << endl;			for(auto it = component.begin(); it != component.end(); ++it) {				vector<EdgeId> outgoing = this->g().OutgoingEdges(*it);				for(auto eit = outgoing.begin(); eit != outgoing.end(); ++eit) {					if(component.count(this->g().EdgeEnd(*eit)) == 1) {						cout << this->g().int_id(*it) << " -> " << this->g().int_id(this->g().EdgeEnd(*eit)) << " : " << this->g().length(*eit) << " : " << edges.count(*eit) << " : " << this->g().int_id(*eit) << endl;					}				}			}*/			RemoveExtraEdges(edges, component);			RemoveIsolatedVertices(component);		}	}
开发者ID:fw1121,项目名称:Pandoras-Toolbox-for-Bioinformatics,代码行数:25,


示例9: FindPath

voidProfileListWidget::SelectPath(const TCHAR *path){  auto i = FindPath(path);  if (i >= 0)    GetList().SetCursorIndex(i);}
开发者ID:M-Scholli,项目名称:XCSoar,代码行数:7,


示例10: main

void main(void){    welcome();    InputMaze();    if (FindPath()) OutputPath();    else cout << "No path" << endl;}
开发者ID:hzsunzixiang,项目名称:programming,代码行数:7,


示例11: FindPath

void BinTree::FindPath(int expectedSum) {    if (pHead == NULL)        return ;    std::vector<int> path;    int currentSum = 0;    FindPath (pHead,expectedSum,path,currentSum);}
开发者ID:archibaly,项目名称:ToyCollection,代码行数:7,


示例12: path_check2

void path_check2(){    printf("Testing FindPath(...) on World2/n");    int i, j;    Grid *g;    g = ReadWorld("world2.txt");        Search *s;    s = FindPath(g);    assert_i(s->Length, -1, "Shortest path length - World2");    assert_i(stack_size(s->s), s->Length+1, "Stack size - World2");    int actual[14][17] = {{5000, MAX_INT, MAX_INT, MAX_INT, MAX_INT, MAX_INT, MAX_INT, MAX_INT, MAX_INT, MAX_INT, MAX_INT, MAX_INT, MAX_INT, MAX_INT, MAX_INT},                          {5000,      10,       9,      10,      11,      12,      13,      14,      15,      16,      17,      18, MAX_INT, MAX_INT, MAX_INT},                          {5000,       9,       8,       9,      10,      11,      12,      13,      14,      15,      16,      17, MAX_INT, MAX_INT, MAX_INT},                          {5000,       8,       7,       8,       9,      10,      11,      12,      13,      14,      15,      16,      17,      18, MAX_INT},                          {5000,       7,       6,       7,       8,       9,      10,      11,      12,      13,      14,      15,      16,      17, MAX_INT},                          {5000,       6,       5,       6,       7,       8,       9,      10,      11,      12,      13,      14,      15,      16, MAX_INT},                          {5000,       5,       4, MAX_INT, MAX_INT, MAX_INT, MAX_INT, MAX_INT, MAX_INT, MAX_INT, MAX_INT, MAX_INT,      16,      17, MAX_INT},                          {5000,       4,       3,       2,       1,       2,       3,       4,       5,       6,       7, MAX_INT,      17,      18, MAX_INT},                          {5000,       3,       2,       1,       0,       1,       2,       3,       4,       5,       6, MAX_INT,      18,      19, MAX_INT},                          {5000,       4,       3,       2,       1,       2,       3,       4,       5,       6,       7, MAX_INT,      19,      20, MAX_INT},                          {5000, MAX_INT, MAX_INT, MAX_INT, MAX_INT, MAX_INT, MAX_INT, MAX_INT, MAX_INT, MAX_INT, MAX_INT, MAX_INT, MAX_INT, MAX_INT, MAX_INT}};    int correct_dist = 1;    // Compare Calculated Distances to Model Solution.    for(i = 0; i < g->rows; i++){        for(j = 0; j < g->cols; j++){            if(actual[i][j] != s->Distance[i][j]){                correct_dist = 0;            }         }    }    assert_i(correct_dist, 1, "Distance Array - World2");}
开发者ID:TRex22,项目名称:DDS_Group_Work,代码行数:35,


示例13: updateMap

void updateMap() {    for(int i = 0; i < mapWidth; ++i) {    for(int j = 0; j < mapHeight; ++j) {      QGraphicsRectItem* rect = rects[RectsKey(j, i)];      if(pMap[i*mapWidth+j] == 0)        rect->setBrush(QBrush(Qt::blue));      if(pMap[i*mapWidth+j] == 1)        rect->setBrush(QBrush(Qt::red));    }  }  int pOutBuffer[128];  int nNumSteps = FindPath(startX, startY, endX, endY, pMap, mapWidth, mapHeight, pOutBuffer, 128);  for(int i = 0; i < nNumSteps; i++) {    int y = pOutBuffer[i]/mapWidth;    int x = pOutBuffer[i] - y*mapWidth;    QGraphicsRectItem* rect = rects[RectsKey(x, y)];    rect->setBrush(QBrush(Qt::green));  }  if(startX != -1 && startY != -1)  {    QGraphicsRectItem* rect = rects[RectsKey(startX, startY)];    rect->setBrush(QBrush(Qt::green));  }  if(endX != -1 && endY != -1)  {    QGraphicsRectItem* rect = rects[RectsKey(endX, endY)];    rect->setBrush(QBrush(Qt::gray));  }}
开发者ID:tobiasor,项目名称:PathFinder,代码行数:35,


示例14: rand

void Enemy::GenerateRandomPath(){	pathStatus = PathFinder::NONEXISTENT;	for( int i = 0 ; i < numberOfRandomPathPoints ; i++ )	{		do{		target.x = rand()%( 2 * MovementVector.x ) + ( startPosition.x - MovementVector.x );		target.y = rand()%( 2 * MovementVector.y ) + ( startPosition.y - MovementVector.y );	//	std::cout<<target.x<<" "<<target.y<<"/n";		pathSearched = false;		if( (target.x/32 != myPosition.x/32) &&		    (target.y/32 != myPosition.y/32) )		{			if( FindPath( target ) == PathFinder::FOUND )			{				pathStatus = PathFinder::NONEXISTENT;				randomPatrolPath[i] = pathfinderPath;				break;			}		}		}while( pathStatus != PathFinder::FOUND );	}				}
开发者ID:KNTGPolygon,项目名称:3Man,代码行数:25,


示例15: bm_Periodical_1s

void bm_Periodical_1s(){	for (u32 i=0;i<del_blocks.size();i++)		delete del_blocks[i];	del_blocks.clear();	if (rebuild_counter>0) rebuild_counter--;#if HOST_OS==OS_WINDOWS && 0	std::sort(all_blocks.begin(),all_blocks.end(),UDgreaterX);	map<u32,u32> vmap;	map<u32,u32> calls;	u32 total_runs=0;	for(int i=0;i<all_blocks.size();i++)	{		RuntimeBlockInfo* rbi=all_blocks[i];		total_runs+=rbi->runs;		if (rbi->BranchBlock!=-1 && rbi->BranchBlock < rbi->addr)		{			if (rbi->BlockType==BET_Cond_0 || rbi->BlockType==BET_Cond_1 || rbi->BlockType==BET_StaticJump)			{				RuntimeBlockInfo* bbi=bm_GetBlock(all_blocks[i]->BranchBlock);				if (bbi && bbi->runs)				{					vmap[all_blocks[i]->BranchBlock]=bbi->runs;				}			}			if (rbi->BlockType==BET_StaticCall)			{				RuntimeBlockInfo* bbi=bm_GetBlock(all_blocks[i]->BranchBlock);				if (bbi && bbi->runs)				{					calls[all_blocks[i]->BranchBlock]+=rbi->runs;				}			}		}		verify(rbi->NextBlock>rbi->addr);	}	map<u32,u32>::iterator iter=vmap.begin();	total_saved=0;	u32 total_l_runs=0;	while(iter!=vmap.end())	{		FindPath(iter->first);		total_l_runs+=iter->second;		iter++;	}	for(int i=0;i<all_blocks.size();i++)		all_blocks[i]->runs=0;	printf("Total Saved: %.2f || Total Loop Runs: %.2f  || Total Runs: %.2f/n",total_saved/1000.f,total_l_runs/1000.f,total_runs/1000.f);#endif}
开发者ID:zear,项目名称:emulator,代码行数:59,


示例16: FindClosestNode

PathPlan* PathingGraph::FindPath(const Vec3& startPoint, const Vec3& endPoint){	// Find the closest nodes to the start and end points.  There really should be some ray-casting 	// to ensure that we can actually make it to the closest node, but this is good enough for now.	PathingNode* pStart = FindClosestNode(startPoint);	PathingNode* pGoal = FindClosestNode(endPoint);	return FindPath(pStart,pGoal);}
开发者ID:wsantas,项目名称:gamecode4,代码行数:8,


示例17: main

void main(void){   Position s,f, *p;   int l;   InputGrid(s,f);   if (FindPath(s,f,l,p)) OutputPath(l,p);   else cout << "No path" << endl;}
开发者ID:hzsunzixiang,项目名称:programming,代码行数:8,


示例18: OnButtonExecuteClick

void MapOverview::OnButtonExecuteClick(wxCommandEvent& event){   signed int res=FindPath(GetWorldHandler(),OURROBOT,100); //TimeMS->GetValue()*10  //floor_plan->FindPathTo(endx,endy,);  if ( res <1 ) { fprintf(stderr,"Could not establish a route./n"); /*TTS((char *)"Could not establish a route.");*/  } else                { fprintf(stderr,"New route established."); }  Refresh();}
开发者ID:AmmarkoV,项目名称:RoboVision,代码行数:8,


示例19: GeneratePath

void Player::GeneratePath(){	path.clear();	next = NULL;	x = nodeMap->GetStart()->x;	y = nodeMap->GetStart()->y;	path = *FindPath();}
开发者ID:JeffreyMJohnson,项目名称:graphs_trees_exercise,代码行数:8,


示例20: FindPath

void FindPath(BinaryTreeNode* pRoot, int expectedSum){	if(pRoot == NULL)		return;	std::vector<int> path;	int currentSum = 0;	FindPath(pRoot, expectedSum, path, currentSum);}
开发者ID:song-syj,项目名称:pro,代码行数:8,


示例21: Test

// ====================测试代码====================void Test(char* testName, BinaryTreeNode* pRoot, int expectedSum){    if(testName != NULL)        printf("%s begins:/n", testName);    FindPath(pRoot, expectedSum);    printf("/n");}
开发者ID:1461190388,项目名称:hht,代码行数:10,


示例22: PlayMove

//===============================================================================//Play Functions:int PlayMove(HWND hwnd, int dx, int dy) {		ptagLevel cur_level;	int curx,cury;	int iRow, iCol;		int *iGoRecord;	int a;	BOOL bRet;	int curbefore,curafter;	int nextbefore,nextafter;	ptagStep pAStep;	cur_level = theMap->currentLevel;	iCol = cur_level->col;	a = cur_level->data[dy * iCol + dx];	if ((a != B_GOAL) && (a != B_NOTHING))		return 0;		iRow = cur_level->row;	curx = cur_level->manx;	cury = cur_level->many;	iGoRecord = (int *) calloc (iRow * iCol, sizeof(int));	memcpy(iGoRecord, cur_level->data, iRow * iCol * sizeof(int));	bRet = FindPath(iGoRecord, curx, cury, dx, dy, iRow, iCol);	free(iGoRecord);	if (!bRet) 		return 0;		curbefore = cur_level->data[cury  * iCol + curx];	curafter  = manLeave[curbefore];	nextbefore = cur_level->data[dy * iCol + dx];	nextafter  = manGoInto[nextbefore];	assert(curafter != B_FORBID);	assert(nextafter != B_FORBID);	//for UNDO	pAStep = (ptagStep) calloc (1, sizeof(Step));	pAStep->iType  = STEP_TYPE_MOVE;	pAStep->pt1[0] = curx;	pAStep->pt1[1] = cury;	pAStep->pt1[2] = curbefore;	pAStep->pt2[0] = dx;	pAStep->pt2[1] = dy;	pAStep->pt2[2] = nextbefore;	PushStep(pAStep);	//act	cur_level->data[cury  * iCol + curx]  = curafter;	cur_level->data[dy * iCol + dx] = nextafter;	DrawALittleBlock(hwnd, curx, cury, curafter);		DrawALittleBlock(hwnd, dx, dy, nextafter);		cur_level->manx = dx;	cur_level->many = dy;		return STEP_TYPE_MOVE;}
开发者ID:Trietptm-on-Coding-Algorithms,项目名称:CodeLibrary,代码行数:59,


示例23: OgreVect3ToFloatA

int OgreRecast::FindPath(Ogre::Vector3 startPos, Ogre::Vector3 endPos, int nPathSlot, int nTarget){    float start[3];    float end[3];    OgreVect3ToFloatA(startPos, start);    OgreVect3ToFloatA(endPos, end);    return FindPath(start,end,nPathSlot,nTarget);}
开发者ID:arrian,项目名称:3d-engine,代码行数:9,


示例24: FindPath

u32 FindPath(RuntimeBlockInfo* rbi, u32 sa,s32 mc,u32& plc){	if (mc < 0 || rbi==0)		return 0;	plc++;	if (rbi->BlockType==BET_Cond_0 || rbi->BlockType==BET_Cond_1)	{		u32 plc1=plc,plc2=plc,v1=0,v2=0;		if (rbi->BranchBlock>sa)		{			v1=FindPath(bm_GetBlock(rbi->BranchBlock),rbi->addr,mc-rbi->guest_cycles,plc1);		}		v2=FindPath(bm_GetBlock(rbi->NextBlock),rbi->addr,mc-rbi->guest_cycles,plc2);		if (plc1>plc2)		{			plc=plc1;			return rbi->guest_cycles+v1;		}		else		{			plc=plc2;			return rbi->guest_cycles+v2;		}			}	else if (rbi->BlockType==BET_StaticJump)	{		if (rbi->BranchBlock>sa)			return rbi->guest_cycles+FindPath(bm_GetBlock(rbi->BranchBlock),rbi->addr,mc-rbi->guest_cycles,plc);		else		{			return rbi->guest_cycles;		}	}	else	{		if (plc!=1)			printf("Chain lost due to %d/n",rbi->BlockType);		else			printf("Chain fail due to %d/n",rbi->BlockType);		return rbi->guest_cycles;	}}
开发者ID:zear,项目名称:emulator,代码行数:44,


示例25: FindPath

bool CWallDirListItem::RemoveAllPath(CString &sPath){	bool bRes = false;	if (m_mux.Lock()) {		int iIndex = FindPath(sPath);		if (iIndex >= 0) {			bRes = true;		} else {			bRes = false;		}		while (iIndex >= 0) {			m_saPicPath.RemoveAt(iIndex);			iIndex = FindPath(sPath);		}		m_mux.Unlock();	}	return bRes;}
开发者ID:tsaikd,项目名称:MagicKD,代码行数:19,


示例26: FindPath

vector<vector<int>> FindPath(BinaryTreeNode *root, int expectedSum){    vector<vector<int>> res;    vector<int> path;        FindPath(root, expectedSum, path, res);        return res;}
开发者ID:lixinming913,项目名称:c_plus_learning,代码行数:10,


示例27: FindPathTest

void FindPathTest(double map, double pathFinder, int w, int h, int cellSize, bool outputMap){	double path = FindPath(pathFinder, 2.0*cellSize, 8.0*cellSize, (w-2)*cellSize, 2.0*cellSize);    //double path = FindPath(pathFinder, (w-2)*cellSize, 2.0*cellSize, 2.0*cellSize, 8.0*cellSize);	if (outputMap)	{		OutputPath(map, path);	}	DestroyPath(path);}
开发者ID:suilevap,项目名称:motion-plan,代码行数:12,


示例28: FindPath

// Check if we have a matching triggerint GotoFileList::FindMatchesAndSelection(const std::map<wxString,wxString>& triggers) {	if (!m_items.size()) return wxNOT_FOUND;	int selection = wxNOT_FOUND;	std::map<wxString,wxString>::const_iterator p = triggers.find(m_searchText);	if (p != triggers.end())		selection = FindPath(p->second);	if (selection != wxNOT_FOUND)		return selection;	// Check if we have a partial match, using saved triggers	for (p = triggers.begin(); p != triggers.end(); ++p) {		if (!p->first.StartsWith(m_searchText)) continue;		selection = FindPath(p->second);		if (selection != wxNOT_FOUND) continue;		// Since we have a trigger but it is not in list yet		// Let's check if it exists and add it temporarily		if (wxFileExists(p->second)) {			m_tempEntry->SetPath(p->second);			// Add entry with highlighted search chars			AddFileIfMatching(m_searchText, m_tempEntry);			// Find position it will end up after sort			std::vector<aItem>::iterator insPos = lower_bound(m_items.begin(), m_items.end()-1, m_items.back());			selection = distance(m_items.begin(), insPos);			// Move item to correct position			if (m_items.size() > 1)				inplace_merge(m_items.begin(), m_items.end()-1, m_items.end());			return selection;		}	}	return selection;}
开发者ID:BBkBlade,项目名称:e,代码行数:41,


示例29: main

int main(){	// Case #0	int case_zero_result = FindPath(0, 0, 3, 2, gCaseZeroMap, 4, 3, gCaseZeroBuffer, gCaseZeroBufferSize);	LogResult(4 * 0 + 0, case_zero_result, gCaseZeroBuffer);	// Case #1	int case_one_result = FindPath(2, 0, 0, 2, gCaseOneMap, 3, 3, gCaseOneBuffer, gCaseOneBufferSize);	LogResult(3 * 0 + 2, case_one_result, gCaseOneBuffer);	// Case #2 - test with a larger map	int result = FindPath(0, 0, 4, 5, gLargerMap, 5, 6, gLargerBuffer, gLargerBufferSize);	LogResult(0, result, gLargerBuffer);	// Case #3 - map with only one available path, but we can't move diagonally so it is invalid	int one_available_result = FindPath(0, 0, 1, 1, gOneAvailableMap, 2, 2, gOneAvialableBuffer, gOneAvailableBufferSize);	LogResult(0, one_available_result, gOneAvialableBuffer);	// Case #4 - output buffer is too small to hold the output buffer	int small_buffer_result = FindPath(0, 0, 3, 3, gSmallBufferMap, 4, 4, gSmallBufferBuffer, gSmallBufferBufferSize);	LogResult(0, small_buffer_result, gSmallBufferBuffer);	// Case #5 - huge map	int huge_map_result = FindPath(0, 0, 0, 19, gHugeMap, 20, 20, gHugeBuffer, gHugeBufferSize);	LogResult(0, huge_map_result, gHugeBuffer);		return 0;}
开发者ID:timothythiecke,项目名称:ParadoxPath,代码行数:28,



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


C++ FindPin函数代码示例
C++ FindObject函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。