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


C++ YsArray::DeleteLast方法代码示例

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


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

示例1: if

YsArray <YsShellExt_RoundUtil::VertexPositionPair> YsShellExt_RoundUtil::MakeRoundedVertexSequence(const YsShell &shl,YSSIZE_T nVt,const YsShellVertexHandle vtHdArrayIn[],YSBOOL isLoop) const
{
	YsArray <YsShellVertexHandle> orgVtHdArray(nVt,vtHdArrayIn);
	YsArray <VertexPositionPair> newVtHdArray;

	for(YSSIZE_T orgVtIdx=0; orgVtIdx<orgVtHdArray.GetN(); ++orgVtIdx)
	{
		YSBOOL rounded=YSFALSE;
		for(const auto &roundCorner : cornerArray)
		{
			if(roundCorner.fromVtHd==orgVtHdArray[orgVtIdx])
			{
				int forward=0,backward=1;

				if(roundCorner.toVtHd[0]==orgVtHdArray.GetCyclic(orgVtIdx-1))
				{
					forward=1;
					backward=0;
				}
				else if(roundCorner.toVtHd[1]==orgVtHdArray.GetCyclic(orgVtIdx-1))
				{
					forward=0;
					backward=1;
				}
				else
				{
					continue;
				}

				YSBOOL skipFirst=YSFALSE;

				if(0<newVtHdArray.GetN() && newVtHdArray.Last().pos==roundCorner.subDiv[backward].Last().pos)
				{
					skipFirst=YSTRUE;
				}

				newVtHdArray.Append(roundCorner.subDiv[backward]);

				newVtHdArray.Increment();
				newVtHdArray.Last().vtHd=orgVtHdArray[orgVtIdx];
				newVtHdArray.Last().pos=roundCorner.roundedCornerPos;

				for(YSSIZE_T i=roundCorner.subDiv[forward].GetN()-1; 0<=i; --i)
				{
					if(YSTRUE==skipFirst)
					{
						skipFirst=YSFALSE;
						continue;
					}
					newVtHdArray.Append(roundCorner.subDiv[forward][i]);
				}

				rounded=YSTRUE;
			}
		}
		if(YSTRUE!=rounded)
		{
			newVtHdArray.Increment();
			newVtHdArray.Last().vtHd=orgVtHdArray[orgVtIdx];
			newVtHdArray.Last().pos=shl.GetVertexPosition(newVtHdArray.Last().vtHd);
		}
	}

	if(2<=newVtHdArray.GetN() && YSTRUE==isLoop && newVtHdArray[0].pos==newVtHdArray.Last().pos)
	{
		newVtHdArray.DeleteLast();
	}

	return newVtHdArray;
}
开发者ID:ninkamat,项目名称:CMU-24-681-CAD-MIProject,代码行数:70,代码来源:ysshellext_roundutil.cpp


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