ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

void monoTriangulationRecFunBackend ( Real topVertex,
Real botVertex,
vertexArray inc_chain,
Int  inc_current,
vertexArray dec_chain,
Int  dec_current,
Int(*)(Real *, Real *)  compFun,
Backend backend 
)

Definition at line 297 of file monoTriangulationBackend.cc.

Referenced by monoTriangulationFunBackend(), and monoTriangulationRecFunBackend().

{
  assert( inc_chain != NULL && dec_chain != NULL);
  assert( ! (inc_current>=inc_chain->getNumElements() &&
         dec_current>=dec_chain->getNumElements()));
  Int inc_nVertices;
  Int dec_nVertices;
  Real** inc_array ;
  Real** dec_array ;
  Int i;
  assert( ! ( (inc_chain==NULL) && (dec_chain==NULL)));

  if(inc_current>=inc_chain->getNumElements()) /*no more vertices on inc_chain*/
    {

      dec_array = dec_chain->getArray();
      dec_nVertices = dec_chain->getNumElements();      
      reflexChain rChain(20,0);
      /*put the top vertex into the reflex chain*/
      rChain.processNewVertex(topVertex, backend);
      /*process all the vertices on the dec_chain*/
      for(i=dec_current; i<dec_nVertices; i++){
    rChain.processNewVertex(dec_array[i], backend);
      }
      /*process the bottom vertex*/
      rChain.processNewVertex(botVertex, backend);

    }
  else if(dec_current>= dec_chain->getNumElements()) /*no more vertices on dec_chain*/
    {
      inc_array = inc_chain->getArray();
      inc_nVertices= inc_chain->getNumElements();
      reflexChain rChain(20,1);
      /*put the top vertex into the reflex chain*/
      rChain.processNewVertex(topVertex, backend);
      /*process all the vertices on the inc_chain*/
      for(i=inc_current; i<inc_nVertices; i++){
    rChain.processNewVertex(inc_array[i], backend);
      }
      /*process the bottom vertex*/
      rChain.processNewVertex(botVertex, backend);
    }
  else /*neither chain is empty*/
    {
      inc_array = inc_chain -> getArray();
      dec_array = dec_chain -> getArray();
      inc_nVertices= inc_chain->getNumElements();
      dec_nVertices= dec_chain->getNumElements();
      /*if top of inc_chain is 'lower' than top of dec_chain, process all the 
       *vertices on the dec_chain which are higher than top of inc_chain
       */
      if(compFun(inc_array[inc_current], dec_array[dec_current]) <= 0)
    {

      reflexChain rChain(20, 0);
      rChain.processNewVertex(topVertex, backend);
      for(i=dec_current; i<dec_nVertices; i++)
        {
          if(compFun(inc_array[inc_current], dec_array[i]) <= 0)
        rChain.processNewVertex(dec_array[i], backend);
          else 
        break;
        }
      rChain.outputFan(inc_array[inc_current], backend);
      monoTriangulationRecFunBackend(dec_array[i-1], botVertex, 
                   inc_chain, inc_current,
                   dec_chain, i,
                   compFun,
                   backend);
    }
      else /*compFun(inc_array[inc_current], dec_array[dec_current]) > 0*/
    {

      reflexChain rChain(20, 1);
      rChain.processNewVertex(topVertex, backend);
      for(i=inc_current; i<inc_nVertices; i++)
        {
          if(compFun(inc_array[i], dec_array[dec_current]) >0)      
        rChain.processNewVertex(inc_array[i], backend);       
          else
        break;
        }
      rChain.outputFan(dec_array[dec_current], backend);
      monoTriangulationRecFunBackend(inc_array[i-1], botVertex, 
                   inc_chain, i,
                   dec_chain, dec_current,
                   compFun,
                   backend);
    }
    }/*end case neither is empty*/
}

Generated on Sun May 27 2012 05:09:30 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.