Logo Search packages:      
Sourcecode: madlib version File versions  Download package

pFace MAd::M_face ( pMesh  m,
int  id[] 
)

returns the face using the vertices with these id's. Returns NULL if not found.

Definition at line 675 of file MeshDataBaseInterface.cc.

References MAd::E_faces(), MAd::F_edOpVt(), MAd::M_edge(), and MAd::V_id().

Referenced by MAd::M_region().

  {
    pEdge e = M_edge(m,id[0],id[1]);
    if ( !e ) {printf("could not find edge with ids: %d %d\n",id[0],id[1]); return 0;}

    pPList eF = E_faces(e);
    void * tmp = NULL;
    pFace f;
    pVertex v;
    while ( ( f = (pFace)PList_next(eF,&tmp) ) ) {
      v = F_edOpVt(f,e);
      if ( v && ( V_id(v) == id[2] ) ) {
        PList_delete(eF);
        return f;
      }
    }

    PList_delete(eF);
    return 0;
  }


Generated by  Doxygen 1.6.0   Back to index