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


C++ Tab::Delete方法代码示例

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


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

示例1: Validate

BOOL PFOperatorInstanceShapeMXSValidator::Validate(PB2Value& v)
{
	INode* iNode = (INode*)v.r;
	if (iNode == NULL) return NULL;
	TimeValue t = GetCOREInterface()->GetTime();
	Tab<INode*> stack;

	stack.Append(1, &iNode, 10);
	while (stack.Count())
	{
		INode *node = stack[stack.Count()-1];
		stack.Delete(stack.Count()-1, 1);

		Object *obj = node->EvalWorldState(t).obj;
		if (obj->CanConvertToType(Class_ID(TRIOBJ_CLASS_ID, 0)))
			return TRUE;

		// add children to the stack
		for (int i = 0; i < node->NumberOfChildren(); i++) {
			INode *childNode = node->GetChildNode(i);
			if (childNode)	stack.Append(1, &childNode, 10);
		}
	}
	return FALSE;
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:25,代码来源:PFOperatorInstanceShape_ParamBlock.cpp

示例2: TokStr

void Unreal3DExport::RegisterMaterial( IGameNode* node, IGameMesh* mesh, FaceEx* f, FJSMeshTri* tri )
{
    tri->TextureNum = f->matID;

    int matid = f->matID;

    IGameMaterial* mat = mesh->GetMaterialFromFace(f);
    if( mat )
    {
        Tab<TSTR*> tokens = TokStr(mat->GetMaterialName(),_T(" \t,;"));
        for( int i=0; i!=tokens.Count(); ++i )
        {
            if( MatchPattern(*tokens[i],TSTR(_T("F=*")),TRUE) )
            {
                SplitStr(*tokens[i],_T('='));
                tri->Flags = static_cast<byte>(_ttoi(tokens[i]->data()));
            }
        }
        tokens.Delete(0,tokens.Count());

        if( Materials.Count() <= matid )
        {
            Materials.Append(matid-Materials.Count()+1,&sMaterial::DefaultMaterial);
        }
        
        if( Materials[matid].Mat != mat )
        {
            Materials[matid].Mat = mat;
        }

        /*for( int i=0; i!=mat->GetSubMaterialCount(); ++i )
        {
            IGameMaterial* sub = mat->GetSubMaterial(i);
            if( sub )
            {
                TSTR matname = sub->GetMaterialName();
                int subid = mat->GetMaterialID(i);
                int x = 0;
            }
        }*/
    }
}
开发者ID:roman-dzieciol,项目名称:Unreal3DExport,代码行数:42,代码来源:Unreal3DExport.cpp

示例3: OrderLists

void TVConnectionInfo::OrderLists()
{

	int hiddenVertID = -1;
	for (int i = 0; i < mVertex.Count(); i++)
	{




		if (mVertex[i]->mConnectedFaces.Count() > 0)
		{
		//	DumpVert(i);

			//order our faces
			Tab<int> faceStack;
			Tab<int> finalFaceStack;
			Tab<int> remainingFaces = mVertex[i]->mConnectedFaces;
			faceStack.Append(1,&remainingFaces[0]);
			remainingFaces.Delete(0,1);
			int vert = i;
			
			//gather all the faces that are together and ordered them
			while (remainingFaces.Count() > 0)
			{
				int currentFace = faceStack[0];
				int prevVert = -1;
				int nextVert = -1;
				int deg = mMd->GetFaceDegree(currentFace);
				for (int j = 0; j < deg; j++)
				{
					int a = mMd->GetFaceTVVert(currentFace,j);
					if (a == vert)
					{
						nextVert = mMd->GetFaceTVVert(currentFace,(j+1)%deg);
						prevVert = mMd->GetFaceTVVert(currentFace,(j+deg-1)%deg);
						j = deg;
					}
				}

				int  hit = FALSE;
				for (int j = 0; j < remainingFaces.Count(); j++)
				{
					int faceIndex = remainingFaces[j];
					//see if we have any matching faces
					int ithEdge = mMd->FindUVEdge(faceIndex,vert,nextVert);
					if (ithEdge != -1) //we have a match
					{
						faceStack.Append(1,&faceIndex,8);
						remainingFaces.Delete(j,1);					 
						j = -1;
						hit = TRUE;

						//find the new nextvert
						int deg = mMd->GetFaceDegree(faceIndex);						
						for (int k = 0; k < deg; k++)
						{
							int a = mMd->GetFaceTVVert(faceIndex,k);
							if (a == vert)
							{
								nextVert = mMd->GetFaceTVVert(faceIndex,(k+1)%deg);
								k = deg;
							}
						}
					}
					else
					{
						ithEdge = mMd->FindUVEdge(faceIndex,vert,prevVert);
						if (ithEdge != -1) //we have a match
						{
							faceStack.Insert(0,1,&faceIndex);
							remainingFaces.Delete(j,1);
							j = -1;
							hit = TRUE;

							//find the new prevvert
							int deg = mMd->GetFaceDegree(faceIndex);
							for (int k = 0; k < deg; k++)
							{
								int a = mMd->GetFaceTVVert(faceIndex,k);
								if (a == vert)
								{									
									prevVert = mMd->GetFaceTVVert(faceIndex,(k+deg-1)%deg);
									k = deg;
								}
							}
						}						
					}
				}

				//see if we hit an open edge if so add all the faces we have and add a -1 to mark the gap
				int remainingFacesCount = remainingFaces.Count();
				if (hit == FALSE || (remainingFacesCount == 0))
				{
					for (int j = 0; j < faceStack.Count(); j++)
						finalFaceStack.Append(1,&faceStack[j],8);
					int neg = -1;
					if (remainingFaces.Count() != 0)
						finalFaceStack.Append(1,&neg);

//.........这里部分代码省略.........
开发者ID:artemeliy,项目名称:inf4715,代码行数:101,代码来源:TvConnectionInfo.cpp

示例4: EdgeListFromPoints


//.........这里部分代码省略.........
	//	else ourConnects = vConnects;

	//spider out till hit our target or no more left
	BOOL done = FALSE;
	BOOL hit = FALSE;
	Tab<int> vertsToDo;
	BitArray processedVerts;
	processedVerts.SetSize(ourConnects.Count());
	processedVerts.ClearAll();

	//if no more left bail
	int currentVert = source;
	while (!done)
	{
		//	int startingNumberProcessed = processedVerts.NumberSet();

		int ct = ourConnects[currentVert]->connectingVerts.Count();
		processedVerts.Set(currentVert, TRUE);
		for (int j = 0; j < ct; j++)
		{
			int index = ourConnects[currentVert]->connectingVerts[j].vertexIndex;
			if (index == target) 
			{
				done = TRUE;
				hit = TRUE;
			}
			if (!processedVerts[index])
				vertsToDo.Append(1,&index, 10000);
		}

		if (vertsToDo.Count())
		{
			currentVert = vertsToDo[vertsToDo.Count()-1];
			vertsToDo.Delete(vertsToDo.Count()-1,1);
		}

		if (vertsToDo.Count() == 0) done = TRUE;
		//		int endingNumberProcessed = processedVerts.NumberSet();

		if (currentVert == target) 
		{
			done = TRUE;
			hit = TRUE;
		}
		//		if (startingNumberProcessed == endingNumberProcessed)
		//			done = TRUE;
	}
	vertsToDo.ZeroCount();

 	if (hit)
	{
		Tab<VConnections*> solvedNodes;

		ourConnects[source]->accumDist = 0;

		VConnections* unsolvedNodeHead = ourConnects[source];
		VConnections* unsolvedNodeCurrent = unsolvedNodeHead;
		
		//put all our vertices in the unsolved list
		
		for (int i = 0; i < ourConnects.Count(); i++)
		{			
			if (ourConnects[i] != unsolvedNodeHead)
			{
				unsolvedNodeCurrent->linkedListChild = ourConnects[i];
				VConnections *parent = unsolvedNodeCurrent;
开发者ID:artemeliy,项目名称:inf4715,代码行数:67,代码来源:tvdata.cpp

示例5: GetOpenEdges

void UnwrapMod::GetOpenEdges(MeshTopoData *ld, Tab<int> &openEdges, Tab<int> &results)
{
	if (openEdges.Count() == 0) return;


	int seedEdgeA = openEdges[0];

	if (openEdges.Count() > 0)
	{
		int initialEdge = seedEdgeA;
		results.Append(1,&seedEdgeA,5000);
		openEdges.Delete(0,1);

		int seedVert = ld->GetGeomEdgeVert(seedEdgeA,0);//TVMaps.gePtrList[seedEdgeA]->a;
		BOOL done = FALSE;
		int ct = openEdges.Count();
		while (!done)
		{
			for (int i = 0; i < openEdges.Count(); i++)
			{
				int edgeIndex = openEdges[i];

				if (edgeIndex != seedEdgeA)
				{
					int a = ld->GetGeomEdgeVert(edgeIndex,0);//TVMaps.gePtrList[edgeIndex]->a;
					int b = ld->GetGeomEdgeVert(edgeIndex,1);//TVMaps.gePtrList[edgeIndex]->b;
					if (a == seedVert)
					{
						seedVert = b;
						seedEdgeA = edgeIndex;
						results.Append(1,&seedEdgeA,5000);
						openEdges.Delete(i,1);
						
						i = openEdges.Count();
					}
					else if  (b == seedVert)
					{
						seedVert = a;
						seedEdgeA = edgeIndex;
						results.Append(1,&seedEdgeA,5000);
						openEdges.Delete(i,1);
						i = openEdges.Count();
					}
				}
			}					
			if (ct == openEdges.Count())
				done = TRUE;
			ct = openEdges.Count();
		}


		seedEdgeA = initialEdge;

		seedVert =  ld->GetGeomEdgeVert(seedEdgeA,1);//TVMaps.gePtrList[seedEdgeA]->b;
		done = FALSE;
		ct = openEdges.Count();
		while (!done)
		{
			for (int i = 0; i < openEdges.Count(); i++)
			{
				int edgeIndex = openEdges[i];

				if (edgeIndex != seedEdgeA)
				{
					int a = ld->GetGeomEdgeVert(edgeIndex,0);//TVMaps.gePtrList[edgeIndex]->a;
					int b = ld->GetGeomEdgeVert(edgeIndex,1);//TVMaps.gePtrList[edgeIndex]->b;
					if (a == seedVert)
					{
						seedVert = b;
						seedEdgeA = edgeIndex;
						results.Append(1,&seedEdgeA,5000);
						openEdges.Delete(seedEdgeA,1);
						i = openEdges.Count();
					}
					else if  (b == seedVert)
					{
						seedVert = a;
						seedEdgeA = edgeIndex;
						results.Append(1,&seedEdgeA,5000);
						openEdges.Delete(seedEdgeA,1);
						i = openEdges.Count();
					}
				}
			}					
			if (ct == openEdges.Count())
				done = TRUE;
			ct = openEdges.Count();
		}
	}

}
开发者ID:artemeliy,项目名称:inf4715,代码行数:91,代码来源:ToolMapping.cpp

示例6: tri

void Unreal3DExport::GetTris()
{
    
    // Export triangle data
    FJSMeshTri nulltri = FJSMeshTri();
    for( int n=0; n<Nodes.Count(); ++n )
    {
        CheckCancel();
        
        IGameNode* node = Nodes[n];
        IGameMesh* mesh = static_cast<IGameMesh*>(node->GetIGameObject());
        if( mesh->InitializeData() )
        {
            int vertcount = mesh->GetNumberOfVerts();
            int tricount = mesh->GetNumberOfFaces();
            if( vertcount > 0 && tricount > 0 )
            {
                // Progress
                ProgressMsg.printf(GetString(IDS_INFO_MESH),n+1,Nodes.Count(),TSTR(node->GetName()));
                pInt->ProgressUpdate(Progress+(static_cast<float>(n)/Nodes.Count()*U3D_PROGRESS_MESH), FALSE, ProgressMsg.data());

                // Alloc triangles space
                Tris.Resize(Tris.Count()+tricount);

                // Append triangles
                for( int i=0; i!=tricount; ++i )
                {
                    FaceEx* f = mesh->GetFace(i);
                    if( f )
                    {
                        FJSMeshTri tri(nulltri);

                        // TODO: add material id listing
                        RegisterMaterial( node, mesh, f, &tri );

                        tri.iVertex[0] = VertsPerFrame + f->vert[0];
                        tri.iVertex[1] = VertsPerFrame + f->vert[1];
                        tri.iVertex[2] = VertsPerFrame + f->vert[2];

                        Point2 p;
                        if( mesh->GetTexVertex(f->texCoord[0],p) ){
                            tri.Tex[0] = FMeshUV(p);
                        }
                        if( mesh->GetTexVertex(f->texCoord[1],p) ){
                            tri.Tex[1] = FMeshUV(p);
                        }
                        if( mesh->GetTexVertex(f->texCoord[2],p) ){
                            tri.Tex[2] = FMeshUV(p);
                        }
                        
                        Tris.Append(1,&tri);                       
                    }
                }

                VertsPerFrame += vertcount;
            }
            else
            {
                // remove invalid node
                Nodes.Delete(n--,1);
            }
        }
        node->ReleaseIGameObject();
    }
    Progress += U3D_PROGRESS_MESH;
}
开发者ID:roman-dzieciol,项目名称:Unreal3DExport,代码行数:66,代码来源:Unreal3DExport.cpp

示例7: NormalMap


//.........这里部分代码省略.........
			skipFace.Set(i);
	}





	for (int i =0; i < objNormList.Count(); i++)
	{
		int index = -1;
		float angle = 0.0f;
		if (skipFace[i] == FALSE)
		{
			for (int j =0; j < clusterList.Count(); j++)
			{
				if (clusterList[j]->ld == this)
				{
					Point3 debugNorm = objNormList[i];
					float dot = DotProd(debugNorm,clusterList[j]->normal);//mapNormal[j]);
					float newAngle = (acos(dot));

					if ((dot >= 1.0f) || (newAngle <= angle) || (index == -1))
					{
						index = j;
						angle = newAngle;
					}
				}
			}
			if (index != -1)
			{
				clusterList[index]->faces.Append(1,&i);
			}
		}
	}


	

	BitArray sel;
	sel.SetSize(TVMaps.f.Count());
	
	for (int i =0; i < clusterList.Count(); i++)
	{
		if (clusterList[i]->ld == this)
		{
			sel.ClearAll();
			for (int j = 0; j < clusterList[i]->faces.Count();j++)
				sel.Set(clusterList[i]->faces[j]);
			if (sel.NumberSet() > 0)
			{
	//			fnSelectPolygonsUpdate(&sel, FALSE);
				mFSel = sel;
				PlanarMapNoScale(clusterList[i]->normal,mod);

			}

			int per = (i * 100)/clusterList.Count();
			statusMessage.printf(_T("%s %d%%."),GetString(IDS_PW_STATUS_MAPPING),per);
			if (mod->Bail(GetCOREInterface(),statusMessage))
			{
				i = clusterList.Count();
				bContinue =  FALSE;
			}
		}
	}

	


	for (int i =0; i < clusterList.Count(); i++)
	{
		if (clusterList[i]->faces.Count() == 0)
		{
			delete clusterList[i];
			clusterList.Delete(i,1);
			i--;
		}

	}

	BitArray clusterVerts;
	clusterVerts.SetSize(TVMaps.v.Count());
	
	for (int i =0; i < clusterList.Count(); i++)
	{
		
		if (clusterList[i]->ld == this)
		{
			clusterVerts.ClearAll();
			for (int j = 0; j < clusterList[i]->faces.Count(); j++)
			{
				int findex = clusterList[i]->faces[j];
				AddVertsToCluster(findex,clusterVerts, clusterList[i]);
			}
		}
	}
	mFSel = holdPolySel ;

	return bContinue;
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:101,代码来源:MeshTopoData_MappingMethods.cpp


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