|
|
| void sampleCompTop |
( |
Real * |
topVertex, |
|
|
vertexArray * |
leftChain, |
|
|
Int |
leftStartIndex, |
|
|
vertexArray * |
rightChain, |
|
|
Int |
rightStartIndex, |
|
|
gridBoundaryChain * |
leftGridChain, |
|
|
gridBoundaryChain * |
rightGridChain, |
|
|
Int |
gridIndex1, |
|
|
Int |
up_leftCornerWhere, |
|
|
Int |
up_leftCornerIndex, |
|
|
Int |
up_rightCornerWhere, |
|
|
Int |
up_rightCornerIndex, |
|
|
primStream * |
pStream |
|
) |
| |
Definition at line 470 of file sampleCompTop.cc.
Referenced by sampleConnectedComp().
{
if(up_leftCornerWhere == 1 && up_rightCornerWhere == 1)
{
leftGridChain->getGrid()->outputFanWithPoint(leftGridChain->getVlineIndex(gridIndex1),
leftGridChain->getUlineIndex(gridIndex1),
rightGridChain->getUlineIndex(gridIndex1),
topVertex,
pStream);
return;
}
else if(up_leftCornerWhere != 0)
{
Real* tempTop;
Int tempRightStart;
if(up_leftCornerWhere == 1){
tempRightStart = rightStartIndex;
tempTop = topVertex;
}
else
{
tempRightStart = up_leftCornerIndex+1;
tempTop = rightChain->getVertex(up_leftCornerIndex);
}
sampleTopRightWithGridLine(tempTop, rightChain, tempRightStart, up_rightCornerIndex,
rightGridChain->getGrid(),
leftGridChain->getVlineIndex(gridIndex1),
leftGridChain->getUlineIndex(gridIndex1),
rightGridChain->getUlineIndex(gridIndex1),
pStream);
}
else if(up_rightCornerWhere != 2)
{
Real* tempTop;
Int tempLeftStart;
if(up_rightCornerWhere == 1)
{
tempLeftStart = leftStartIndex;
tempTop = topVertex;
}
else
{
tempLeftStart = up_rightCornerIndex+1;
tempTop = leftChain->getVertex(up_rightCornerIndex);
}
sampleCompTopSimple(topVertex,
leftChain,
leftStartIndex,
rightChain,
rightStartIndex,
leftGridChain,
rightGridChain,
gridIndex1,
up_leftCornerWhere,
up_leftCornerIndex,
up_rightCornerWhere,
up_rightCornerIndex,
pStream);
}
else
{
sampleCompTopSimple(topVertex,
leftChain,
leftStartIndex,
rightChain,
rightStartIndex,
leftGridChain,
rightGridChain,
gridIndex1,
up_leftCornerWhere,
up_leftCornerIndex,
up_rightCornerWhere,
up_rightCornerIndex,
pStream);
return;
#ifdef NOT_REACHABLE //code is not reachable, for test purpose only
Int sep_left, sep_right;
if(findTopSeparator(leftChain,
leftStartIndex,
up_leftCornerIndex,
rightChain,
rightStartIndex,
up_rightCornerIndex,
sep_left,
sep_right)
)
{
if( leftChain->getVertex(sep_left)[0] >= leftGridChain->get_u_value(gridIndex1) &&
rightChain->getVertex(sep_right)[0] <= rightGridChain->get_u_value(gridIndex1))
{
Int gridSep;
Int segLeftSmall, segLeftLarge, segRightSmall, segRightLarge;
Int valid=1;
findTopLeftSegment(leftChain,
sep_left,
up_leftCornerIndex,
leftGridChain->get_u_value(gridIndex1),
segLeftSmall,
segLeftLarge);
findTopRightSegment(rightChain,
sep_right,
up_rightCornerIndex,
rightGridChain->get_u_value(gridIndex1),
segRightSmall,
segRightLarge);
if(leftChain->getVertex(segLeftSmall)[1] >= rightChain->getVertex(segRightSmall)[1])
{
gridSep = rightGridChain->getUlineIndex(gridIndex1);
while(leftGridChain->getGrid()->get_u_value(gridSep) > leftChain->getVertex(segLeftSmall)[0])
gridSep--;
if(segLeftSmall<segLeftLarge)
if(leftGridChain->getGrid()->get_u_value(gridSep) < leftChain->getVertex(segLeftSmall+1)[0])
{
valid = 0;
}
}
else
{
gridSep = leftGridChain->getUlineIndex(gridIndex1);
while(leftGridChain->getGrid()->get_u_value(gridSep) < rightChain->getVertex(segRightSmall)[0])
gridSep++;
if(segRightSmall<segRightLarge)
if(leftGridChain->getGrid()->get_u_value(gridSep) > rightChain->getVertex(segRightSmall+1)[0])
{
valid = 0;
}
}
if(! valid)
{
sampleCompTopSimple(topVertex,
leftChain,
leftStartIndex,
rightChain,
rightStartIndex,
leftGridChain,
rightGridChain,
gridIndex1,
up_leftCornerWhere,
up_leftCornerIndex,
up_rightCornerWhere,
up_rightCornerIndex,
pStream);
}
else
{
sampleTopLeftWithGridLinePost(leftChain->getVertex(segLeftSmall),
leftChain,
segLeftSmall+1,
segLeftSmall+1,
segLeftLarge,
up_leftCornerIndex,
leftGridChain->getGrid(),
leftGridChain->getVlineIndex(gridIndex1),
leftGridChain->getUlineIndex(gridIndex1),
gridSep,
pStream);
sampleTopRightWithGridLinePost(rightChain->getVertex(segRightSmall),
rightChain,
segRightSmall+1,
segRightSmall+1,
segRightLarge,
up_rightCornerIndex,
leftGridChain->getGrid(),
leftGridChain->getVlineIndex(gridIndex1),
gridSep,
rightGridChain->getUlineIndex(gridIndex1),
pStream);
Real tempBot[2];
tempBot[0] = leftGridChain->getGrid()->get_u_value(gridSep);
tempBot[1] = leftGridChain->get_v_value(gridIndex1);
monoTriangulationRecGen(topVertex, tempBot,
leftChain, leftStartIndex, segLeftSmall,
rightChain, rightStartIndex, segRightSmall,
pStream);
}
}
else if(leftChain->getVertex(sep_left)[0] >= leftGridChain->get_u_value(gridIndex1))
{
Int segLeftSmall, segLeftLarge;
findTopLeftSegment(leftChain,
sep_left,
up_leftCornerIndex,
leftGridChain->get_u_value(gridIndex1),
segLeftSmall,
segLeftLarge);
assert(segLeftLarge >= sep_left);
monoTriangulation2(leftChain->getVertex(segLeftLarge),
leftGridChain->get_vertex(gridIndex1),
leftChain,
segLeftLarge+1,
up_leftCornerIndex,
1,
pStream);
stripOfFanLeft(leftChain, segLeftLarge, segLeftSmall,
leftGridChain->getGrid(),
leftGridChain->getVlineIndex(gridIndex1),
leftGridChain->getUlineIndex(gridIndex1),
rightGridChain->getUlineIndex(gridIndex1),
pStream, 0);
monoTriangulationRecGen(topVertex, rightGridChain->get_vertex(gridIndex1),
leftChain, leftStartIndex, segLeftSmall,
rightChain, rightStartIndex, up_rightCornerIndex,
pStream);
}
else if(rightChain->getVertex(sep_right)[0] <= rightGridChain->get_u_value(gridIndex1))
{
Int segRightSmall, segRightLarge;
findTopRightSegment(rightChain,
sep_right,
up_rightCornerIndex,
rightGridChain->get_u_value(gridIndex1),
segRightSmall,
segRightLarge);
assert(segRightLarge>=sep_right);
monoTriangulation2(rightChain->getVertex(segRightLarge),
rightGridChain->get_vertex(gridIndex1),
rightChain,
segRightLarge+1,
up_rightCornerIndex,
0,
pStream);
stripOfFanRight(rightChain, segRightLarge, segRightSmall,
rightGridChain->getGrid(),
rightGridChain->getVlineIndex(gridIndex1),
leftGridChain->getUlineIndex(gridIndex1),
rightGridChain->getUlineIndex(gridIndex1),
pStream, 0);
monoTriangulationRecGen(topVertex, leftGridChain->get_vertex(gridIndex1),
leftChain, leftStartIndex, up_leftCornerIndex,
rightChain, rightStartIndex,segRightSmall,
pStream);
}
else
{
sampleCompTopSimple(topVertex,
leftChain,
leftStartIndex,
rightChain,
rightStartIndex,
leftGridChain,
rightGridChain,
gridIndex1,
up_leftCornerWhere,
up_leftCornerIndex,
up_rightCornerWhere,
up_rightCornerIndex,
pStream);
}
}
else
{
sampleCompTopSimple(topVertex,
leftChain,
leftStartIndex,
rightChain,
rightStartIndex,
leftGridChain,
rightGridChain,
gridIndex1,
up_leftCornerWhere,
up_leftCornerIndex,
up_rightCornerWhere,
up_rightCornerIndex,
pStream);
}
#endif
}
}
|