|
|
| void sampleCompLeft |
( |
Real * |
topVertex, |
|
|
Real * |
botVertex, |
|
|
vertexArray * |
leftChain, |
|
|
Int |
leftStartIndex, |
|
|
Int |
leftEndIndex, |
|
|
vertexArray * |
rightChain, |
|
|
Int |
rightStartIndex, |
|
|
Int |
rightEndIndex, |
|
|
gridBoundaryChain * |
leftGridChain, |
|
|
Int |
gridIndex1, |
|
|
Int |
gridIndex2, |
|
|
Int |
up_leftCornerWhere, |
|
|
Int |
up_leftCornerIndex, |
|
|
Int |
down_leftCornerWhere, |
|
|
Int |
down_leftCornerIndex, |
|
|
primStream * |
pStream |
|
) |
| |
Definition at line 144 of file sampleComp.cc.
Referenced by sampleConnectedComp().
{
Int midIndex1 = 0;
Int midIndex2 = 0;
Int gridMidIndex1 = 0, gridMidIndex2 = 0;
midIndex1 = leftChain->findIndexBelowGen(
leftGridChain->get_v_value(gridIndex1),
leftStartIndex,
leftEndIndex);
midIndex2 = -1;
if(midIndex1<= leftEndIndex && gridIndex1<gridIndex2)
if(leftChain->getVertex(midIndex1)[1] >= leftGridChain->get_v_value(gridIndex2))
{
midIndex2 = leftChain->findIndexAboveGen(
leftGridChain->get_v_value(gridIndex2),
midIndex1,
leftEndIndex);
gridMidIndex1 = leftGridChain->lookfor(leftChain->getVertex(midIndex1)[1],
gridIndex1, gridIndex2);
gridMidIndex2 = 1+leftGridChain->lookfor(leftChain->getVertex(midIndex2)[1],
gridMidIndex1, gridIndex2);
}
Real* cornerTop;
Real* cornerBot;
Int cornerLeftStart;
Int cornerLeftEnd;
Int cornerRightUpEnd;
Int cornerRightDownStart;
if(up_leftCornerWhere == 0)
{
cornerTop = leftChain->getVertex(up_leftCornerIndex);
cornerLeftStart = up_leftCornerIndex+1;
cornerRightUpEnd = -1;
}
else if(up_leftCornerWhere == 1)
{
cornerTop = topVertex;
cornerLeftStart = leftStartIndex;
cornerRightUpEnd = -1;
}
else
{
cornerTop = topVertex;
cornerLeftStart = leftStartIndex;
cornerRightUpEnd = up_leftCornerIndex;
}
if(down_leftCornerWhere == 0)
{
cornerBot = leftChain->getVertex(down_leftCornerIndex);
cornerLeftEnd = down_leftCornerIndex-1;
cornerRightDownStart = rightEndIndex+1;
}
else if(down_leftCornerWhere == 1)
{
cornerBot = botVertex;
cornerLeftEnd = leftEndIndex;
cornerRightDownStart = rightEndIndex+1;
}
else
{
cornerBot = botVertex;
cornerLeftEnd = leftEndIndex;
cornerRightDownStart = down_leftCornerIndex;
}
if(midIndex2 >= 0)
{
sampleLeftSingleTrimEdgeRegionGen(cornerTop, leftChain->getVertex(midIndex1),
leftChain,
cornerLeftStart,
midIndex1-1,
leftGridChain,
gridIndex1,
gridMidIndex1,
rightChain,
rightStartIndex,
cornerRightUpEnd,
0,
-1,
pStream);
sampleLeftSingleTrimEdgeRegionGen(leftChain->getVertex(midIndex2),
cornerBot,
leftChain,
midIndex2+1,
cornerLeftEnd,
leftGridChain,
gridMidIndex2,
gridIndex2,
rightChain,
0,
-1,
cornerRightDownStart,
rightEndIndex,
pStream);
sampleLeftStripRecF(leftChain,
midIndex1,
midIndex2,
leftGridChain,
gridMidIndex1,
gridMidIndex2,
pStream);
}
else
{
sampleLeftSingleTrimEdgeRegionGen(cornerTop, cornerBot,
leftChain,
cornerLeftStart,
cornerLeftEnd,
leftGridChain,
gridIndex1,
gridIndex2,
rightChain,
rightStartIndex,
cornerRightUpEnd,
cornerRightDownStart,
rightEndIndex,
pStream);
}
}
|