YSRESULT YsShellExt_RoundUtil3d::SetUpForVertexSequence( const YsShellExt &shl, YSSIZE_T nVt,const YsShellVertexHandle vtHdArray[]) { CleanUp(); if(2>nVt || YSTRUE!=shl.IsSearchEnabled()) { return YSERR; } YSSIZE_T nEdPl; const YsShellPolygonHandle *edPlHd; if(YSOK==shl.FindPolygonFromEdgePiece(nEdPl,edPlHd,vtHdArray[0],vtHdArray[1]) && 2==nEdPl) { YsArray <YsShellPolygonHandle> sideAPolygonArray=YsShellExt_TrackingUtil::TrackPolygonOneSideOfVertexSequence( shl,nVt,vtHdArray,1,edPlHd); YsArray <YsShellPolygonHandle> sideBPolygonArray=YsShellExt_TrackingUtil::TrackPolygonOneSideOfVertexSequence( shl,nVt,vtHdArray,1,edPlHd+1); if(0==sideAPolygonArray.GetN() || 0==sideBPolygonArray.GetN()) { return YSERR; } YsArray <YsArray <YsShellVertexHandle> > allBoundary(1,NULL); allBoundary[0].Set(nVt,vtHdArray); return YsShellExt_RoundUtil3d::SetUpForVertexSequenceAndPolygonArray(shl,allBoundary,sideAPolygonArray,sideBPolygonArray); } return YSERR; }
YSRESULT YsShellExt_RoundUtil3d::SetUpForAroundPolygonGroup( const YsShellExt &shl, YSSIZE_T nPl,const YsShellPolygonHandle plHdArray[]) { CleanUp(); if(YSTRUE!=shl.IsSearchEnabled()) { YsPrintf("%s\n",__FUNCTION__); YsPrintf(" This function requires a search table.\n"); return YSERR; } YsShellExt_BoundaryInfo boundary; boundary.MakeInfo((const YsShell &)shl,nPl,plHdArray); if(YSOK!=boundary.CacheContour((const YsShell &)shl)) { return YSERR; } YsShellPolygonStore sideAPolygon((const YsShell &)shl),sideBPolygon((const YsShell &)shl); sideAPolygon.AddPolygon(nPl,plHdArray); YsArray <YsShellPolygonHandle> sideAPolygonArray(nPl,plHdArray),sideBPolygonArray; YsShellEdgeStore boundaryEdge((const YsShell &)shl); for(YSSIZE_T contourIdx=0; contourIdx<boundary.GetNumContour(); ++contourIdx) { YsArray <YsShellVertexHandle> contourVtHd; boundary.GetContour(contourVtHd,contourIdx); if(3<=contourVtHd.GetN()) { if(contourVtHd[0]!=contourVtHd.Last()) { const YsShellVertexHandle vtHd0=contourVtHd[0]; contourVtHd.Append(vtHd0); } for(YSSIZE_T vtIdx=0; vtIdx<contourVtHd.GetN()-1; ++vtIdx) { boundaryEdge.AddEdge(contourVtHd[vtIdx],contourVtHd[vtIdx+1]); YSSIZE_T nVtPl; const YsShellPolygonHandle *vtPlHd; shl.FindPolygonFromVertex(nVtPl,vtPlHd,contourVtHd[vtIdx]); for(YSSIZE_T plIdx=0; plIdx<nVtPl; ++plIdx) { if(YSTRUE!=sideAPolygon.IsIncluded(vtPlHd[plIdx]) && YSTRUE!=sideBPolygon.IsIncluded(vtPlHd[plIdx])) { sideBPolygon.AddPolygon(vtPlHd[plIdx]); sideBPolygonArray.Append(vtPlHd[plIdx]); } } } } } return SetUpForVertexSequenceAndPolygonArray( shl, boundary.GetContourAll(), sideAPolygonArray, sideBPolygonArray); }