Lines Matching refs:leftChain
268 vertexArray* leftChain,
291 leftCornerV = leftChain->getVertex(leftCornerIndex);
298 rightCornerV = leftChain->getVertex(rightCornerIndex);
305 bot_leftCornerV = leftChain->getVertex(bot_leftCornerIndex);
312 bot_rightCornerV = leftChain->getVertex(bot_rightCornerIndex);
346 void toVertexArrays(directedLine* topV, directedLine* botV, vertexArray& leftChain, vertexArray& rightChain)
351 leftChain.appendVertex(topV->getVertex(i));
356 leftChain.appendVertex(tempV->getVertex(i));
431 vertexArray *leftChain, Int leftChainStartIndex, Int leftChainEndIndex,
447 leftChain->print();
463 index1 = leftChain->findIndexBelowGen(v, leftChainStartIndex, leftChainEndIndex);
521 if(leftChain->getVertex(tempI)[1] < v)
527 Real tempMax = leftChain->getVertex(tempI)[0];
529 if(leftChain->getVertex(i)[0] > tempMax)
532 tempMax = leftChain->getVertex(i)[0];
539 if(DBG_intersectChain(leftChain, leftChainStartIndex,leftChainEndIndex,
560 if(leftChain->getVertex(index1)[1] >= rightChain->getVertex(index2)[1]) /*left point above right point*/
569 tempMax = leftChain->getVertex(index1)[0];
574 if(leftChain->getVertex(i)[1] < rightChain->getVertex(index2)[1])
577 if(leftChain->getVertex(i)[0]>tempMax)
580 tempMax = leftChain->getVertex(i)[0];
585 if(DBG_intersectChain(leftChain, leftChainStartIndex,leftChainEndIndex, rightGridPoint, rightChain->getVertex(index2)))
618 if( rightChain->getVertex(i)[1] < leftChain->getVertex(index1)[1])
628 //we check if (leftChain(index1) intersects right chian or not
629 if(DBG_intersectChain(rightChain, rightChainStartIndex, rightChainEndIndex, leftGridPoint, leftChain->getVertex(index1)))
634 else if(tempMin <= leftChain->getVertex(index1)[0] ||
652 vertexArray *leftChain, Int leftChainStartIndex, Int leftChainEndIndex,
678 index1 = leftChain->findIndexFirstAboveEqualGen(v, leftChainStartIndex, leftChainEndIndex);
730 Real tempMax = leftChain->getVertex(index1)[0];
735 if(leftChain->getVertex(i)[0] > tempMax)
738 tempMax = leftChain->getVertex(i)[0];
742 //check whether (rightGridPoint, top) intersects leftChain or not
745 if(DBG_intersectChain(leftChain, leftChainStartIndex,leftChainEndIndex,
761 if(leftChain->getVertex(index1)[1] <= rightChain->getVertex(index2)[1]) /*left point below right point*/
770 tempMax = leftChain->getVertex(index1)[0];
775 if(leftChain->getVertex(i)[1] > rightChain->getVertex(index2)[1])
778 if(leftChain->getVertex(i)[0]>tempMax)
781 tempMax = leftChain->getVertex(i)[0];
785 if(DBG_intersectChain(leftChain, leftChainStartIndex, leftChainEndIndex, rightGridPoint, rightChain->getVertex(index2)))
816 if( rightChain->getVertex(i)[1] > leftChain->getVertex(index1)[1])
826 leftGridPoint, leftChain->getVertex(index1)))
831 else if(tempMin <= leftChain->getVertex(index1)[0] ||
850 Int findNeckF(vertexArray *leftChain, Int botLeftIndex,
860 printf("leftChain is\n");
861 leftChain->print();
866 Int lowerGridIndex; //the grid below leftChain and rightChian vertices
870 if(botLeftIndex >= leftChain->getNumElements() ||
874 v=min(leftChain->getVertex(botLeftIndex)[1], rightChain->getVertex(botRightIndex)[1]);
893 printf("leftChain->get_vertex(0)=(%f,%f)\n", leftChain->getVertex(0)[0],leftChain->getVertex(0)[1]);
894 printf("leftChain->get_vertex(1)=(%f,%f)\n", leftChain->getVertex(1)[0],leftChain->getVertex(1)[1]);
895 printf("leftChain->get_vertex(2)=(%f,%f)\n", leftChain->getVertex(2)[0],leftChain->getVertex(2)[1]);
897 botLeft2 = leftChain->findIndexFirstAboveEqualGen(leftGridChain->get_v_value(lowerGridIndex), botLeftIndex, leftChain->getNumElements()-1) -1 ;
901 printf("leftChain->getNumElements=%i\n", leftChain->getNumElements());
914 Real temp = leftChain->getVertex(tempI)[0];
916 if(leftChain->getVertex(i)[0] > temp)
918 temp = leftChain->getVertex(i)[0];
939 *(leftChain[i], rightChain[j]) is a neck.
941 void findNeck(vertexArray *leftChain, Int botLeftIndex,
947 assert(botLeftIndex < leftChain->getNumElements() &&
952 if(leftChain->getVertex(botLeftIndex)[1] <= rightChain->getVertex(botRightIndex)[1]) //left below right
959 rightLastIndex=rightChain->findIndexAboveGen(leftChain->getVertex(botLeftIndex)[1], botRightIndex+1, rightChain->getNumElements()-1);
966 leftLastIndex = leftChain->findIndexAboveGen(rightChain->getVertex(botRightIndex)[1],
968 leftChain->getNumElements()-1);
1359 vertexArray leftChain(20); /*this is a dynamic array*/
1361 leftChain.appendVertex(topV->getVertex(i));
1366 leftChain.appendVertex(tempV->getVertex(i));
1383 &leftChain,
1404 vertexArray* leftChain,
1453 monoTriangulationRecOpt(topVertex, botVertex, leftChain, leftStartIndex,
1459 monoTriangulationRecGenOpt(topVertex, botVertex, leftChain, leftStartIndex,
1460 leftChain->getNumElements()-1,
1469 monoTriangulationRec(topVertex, botVertex, leftChain, leftStartIndex,
1474 monoTriangulationRec(topVertex, botVertex, leftChain, leftStartIndex,
1479 leftChain, leftStartIndex, leftChain->getNumElements()-1,
1523 Int botLeftIndex = leftChain->findIndexStrictBelowGen(
1526 leftChain->getNumElements()-1);
1535 if(! findNeckF(leftChain, botLeftIndex, rightChain, botRightIndex,
1538 if(botLeftIndex == leftChain->getNumElements() ||
1548 botLeftIndex = leftChain->getNumElements()-1;
1558 findNeck(leftChain, botLeftIndex,
1566 glVertex2fv(leftChain->getVertex(neckLeftIndex));
1571 if(leftChain->getVertex(neckLeftIndex)[1] <= rightChain->getVertex(neckRightIndex)[1])
1573 tempBotVertex = leftChain->getVertex(neckLeftIndex);
1585 nextTopVertex = leftChain->getVertex(neckLeftIndex);
1592 leftChain,
1605 leftChain,
1626 leftChain,
1644 leftChain,
1668 leftChain,
1682 void sampleLeftStrip(vertexArray* leftChain,
1691 assert(leftChain->getVertex(topLeftIndex)[1] > leftGridChain->get_v_value(leftGridChainStartIndex));
1692 assert(leftChain->getVertex(topLeftIndex+1)[1] <= leftGridChain->get_v_value(leftGridChainStartIndex));
1693 assert(leftChain->getVertex(botLeftIndex)[1] <= leftGridChain->get_v_value(leftGridChainEndIndex));
1694 assert(leftChain->getVertex(botLeftIndex-1)[1] > leftGridChain->get_v_value(leftGridChainEndIndex));
1702 upperVert = leftChain->getVertex(topLeftIndex);
1703 lowerVert = leftChain->getVertex(topLeftIndex+1);
1718 sampleLeftStripRec(leftChain, topLeftIndex+1, botLeftIndex,
1724 void sampleLeftStripRec(vertexArray* leftChain,
1749 while(leftChain->getVertex(index1)[1] > secondGridChainV)
1753 sampleLeftOneGridStep(leftChain, topLeftIndex, index1, leftGridChain, leftGridChainStartIndex, pStream);
1764 uppervert = leftChain->getVertex(index1);
1765 lowervert = leftChain->getVertex(index1+1);
1777 /* sampleLeftStripRec(leftChain,
1786 sampleLeftStripRec(leftChain, index1+1, botLeftIndex, leftGridChain, index2, leftGridChainEndIndex, pStream);
1803 void sampleLeftStripRecF(vertexArray* leftChain,
1825 assert(leftChain->getVertex(topLeftIndex)[1] <= leftGridChain->get_v_value(leftGridChainStartIndex) &&
1826 leftChain->getVertex(botLeftIndex)[1] >= leftGridChain->get_v_value(leftGridChainEndIndex));
1836 while(leftChain->getVertex(index1)[1] > secondGridChainV){
1842 /*now leftChain->getVertex(index-1)[1] > secondGridChainV and
1843 * leftChain->getVertex(index)[1] <= secondGridChainV
1849 else if(leftChain->getVertex(index1)[1] < secondGridChainV)
1852 /*now we have leftChain->getVertex(index1)[1] >= secondGridChainV, and
1853 * leftChain->getVertex(index1+1)[1] <= secondGridChainV
1857 sampleLeftOneGridStep(leftChain, topLeftIndex, index1, leftGridChain, leftGridChainStartIndex, pStream);
1860 /*if leftChain->getVertex(index1)[1] == secondGridChainV, then we can recursively do the rest.
1862 if(leftChain->getVertex(index1)[1] == secondGridChainV)
1865 sampleLeftStripRecF(leftChain, index1, botLeftIndex,leftGridChain, leftGridChainStartIndex+1, leftGridChainEndIndex, pStream);
1870 /* Otherwise, we have leftChain->getVertex(index1)[1] > secondGridChainV,
1878 uppervert = leftChain->getVertex(index1);
1879 lowervert = leftChain->getVertex(index1+1); //okay since index1<botLeftIndex
1896 sampleLeftStripRecF(leftChain, index1+1, botLeftIndex, leftGridChain, index2, leftGridChainEndIndex, pStream);
1984 void sampleLeftOneGridStepNoMiddle(vertexArray* leftChain,
2000 leftChain,
2011 void sampleLeftOneGridStep(vertexArray* leftChain,
2019 if(checkMiddle(leftChain, beginLeftIndex, endLeftIndex,
2025 sampleLeftOneGridStepNoMiddle(leftChain, beginLeftIndex, endLeftIndex, leftGridChain, leftGridChainStartIndex, pStream);
2062 sline = new sampledLine(vert1, leftChain->getVertex(beginLeftIndex));
2072 sline = new sampledLine(leftChain->getVertex(i), leftChain->getVertex(i+1));
2080 sline = new sampledLine(leftChain->getVertex(endLeftIndex), vert2);
2121 Real prevU = leftChain->getVertex(i)[0];
2123 Real thisU = leftChain->getVertex(i)[0];
2135 if(i+1 == endLeftIndex && leftChain->getVertex(endLeftIndex)[1] == leftGridChain->get_v_value(1+leftGridChainStartIndex))
2143 j = findIncreaseChainFromBegin(leftChain, beginLeftIndex, i+1/*endLeftIndex*/);
2152 while(leftChain->getVertex(j-1)[1] == leftGridChain->get_v_value(leftGridChainStartIndex))
2160 vert/*leftChain->getVertex(beginLeftIndex)*/,
2161 leftChain->getVertex(j-1),
2162 leftChain,
2172 stripOfFanLeft(leftChain, j-1, temp/*beginLeftIndex*/, leftGridChain->getGrid(),
2181 stripOfFanLeft(leftChain, endLeftIndex, i+1, leftGridChain->getGrid(),
2202 leftChain,
2213 Real prevU = leftChain->getVertex(i)[0];
2215 Real thisU = leftChain->getVertex(i)[0];
2226 stripOfFanLeft(leftChain, i-1, beginLeftIndex, leftGridChain->getGrid(),
2246 leftChain,
2368 void stripOfFanLeft(vertexArray* leftChain,
2395 trimVerts[k][0] = leftChain->getVertex(i)[0];
2396 trimVerts[k][1] = leftChain->getVertex(i)[1];
2401 trimVerts[k][0] = leftChain->getVertex(i)[0];
2402 trimVerts[k][1] = leftChain->getVertex(i)[1];