本文整理汇总了C++中YsShellExt::GetNumPolygonUsingVertex方法的典型用法代码示例。如果您正苦于以下问题:C++ YsShellExt::GetNumPolygonUsingVertex方法的具体用法?C++ YsShellExt::GetNumPolygonUsingVertex怎么用?C++ YsShellExt::GetNumPolygonUsingVertex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类YsShellExt
的用法示例。
在下文中一共展示了YsShellExt::GetNumPolygonUsingVertex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CrawlOneSegment
YSRESULT YsShellExt_SewingInfo::CrawlOneSegment(
YsShellVertexHandle ¤tVtHd,
YsShell::Edge ¤tEdge,
YsShellPolygonHandle ¤tPlHd,
YsVec3 ¤tPos,
const YsShellExt &shl,
const YsVec3 &goalPos,
YsShellVertexHandle goalVtHd)
{
auto startDir=YsUnitVector(goalPos-currentPos);
YsShellCrawler crawler;
crawler.crawlingMode=YsShellCrawler::CRAWL_TO_GOAL;
crawler.goal=goalPos;
YSRESULT started=YSERR;
if(NULL!=currentVtHd)
{
started=crawler.Start(shl.Conv(),currentPos,startDir,currentVtHd);
}
else if(NULL!=currentEdge[0] && NULL!=currentEdge[1])
{
started=crawler.Start(shl.Conv(),currentPos,startDir,currentEdge);
}
else if(NULL!=currentPlHd)
{
started=crawler.Start(shl.Conv(),currentPos,startDir,currentPlHd);
}
if(YSOK==started)
{
if(0==vtxSequence.GetN())
{
vtxSequence.Increment();
vtxSequence.Last().Initialize();
vtxSequence.Last().vtHd=currentVtHd;
vtxSequence.Last().plHd=crawler.currentPlHd;
vtxSequence.Last().pos=crawler.currentPos;
}
else
{
vtxSequence.Last().plHd=crawler.currentPlHd;
}
// Debugging sphere.srf 371 276 375
// [Selected Vertices]
// Vertex Id: 370 Internal Hash Key: 371 Position: -3.467600 -0.689748 3.535534
// Vertex Id: 275 Internal Hash Key: 276 Position: -4.530637 -1.876651 0.975452
// Vertex Id: 374 Internal Hash Key: 375 Position: -1.964237 -2.939689 3.535534
YSBOOL watch=YSFALSE;
while(YSOK==crawler.Crawl(shl.Conv(),0.0,watch))
{
if((crawler.currentState==YsShellCrawler::STATE_ON_VERTEX || crawler.currentEdVtHd[0]==crawler.currentEdVtHd[1]) &&
crawler.currentEdVtHd[0]==vtxSequence.Last().vtHd)
{
vtxSequence.Last().plHd=crawler.currentPlHd;
}
else
{
switch(crawler.currentState)
{
case YsShellCrawler::STATE_IN_POLYGON:
if(crawler.currentPos==goalPos ||
((NULL==goalVtHd || 0==shl.GetNumPolygonUsingVertex(goalVtHd)) && YSTRUE==crawler.reachedDeadEnd)) // Can happen in the end.
{
vtxSequence.Increment();
vtxSequence.Last().Initialize();
vtxSequence.Last().plHd=crawler.currentPlHd;
vtxSequence.Last().vtHd=goalVtHd;
vtxSequence.Last().pos=crawler.currentPos;
if(NULL==goalVtHd)
{
vtxSequence.Last().vtxOnPlgIdx=(int)vtxOnPlg.GetN();
vtxOnPlg.Increment();
vtxOnPlg.Last().plHd=crawler.currentPlHd;
vtxOnPlg.Last().vtHd=goalVtHd;
vtxOnPlg.Last().pos=goalPos;
}
}
break;
case YsShellCrawler::STATE_ON_VERTEX:
vtxSequence.Increment();
vtxSequence.Last().Initialize();
vtxSequence.Last().plHd=crawler.currentPlHd;
vtxSequence.Last().vtHd=crawler.currentEdVtHd[0];
vtxSequence.Last().pos=crawler.currentPos;
break;
case YsShellCrawler::STATE_ON_EDGE:
if(crawler.currentEdVtHd[0]==crawler.currentEdVtHd[1])
{
vtxSequence.Increment();
vtxSequence.Last().Initialize();
vtxSequence.Last().plHd=crawler.currentPlHd;
vtxSequence.Last().vtHd=crawler.currentEdVtHd[0];
vtxSequence.Last().pos=crawler.currentPos;
}
else
{
//.........这里部分代码省略.........