00001 /*! 00002 * \file zcross_extractor.C 00003 * \brief Contains the implementation of the ZCrossExtractor class. 00004 * 00005 * \sa zcross_extractor.H 00006 * 00007 */ 00008 00009 #include "mesh/zcross_extractor.H" 00010 00011 ZCrossPreviousFaceGenerator::ZCrossPreviousFaceGenerator() 00012 { 00013 00014 gen_face = gen_all_faces; 00015 00016 } 00017 00018 void 00019 ZCrossPreviousFaceGenerator::init(const std::vector<ZXseg> &segs) 00020 { 00021 00022 prev_faces.clear(); 00023 00024 if(segs.empty()){ 00025 00026 gen_face = gen_all_faces; 00027 00028 } else { 00029 00030 gen_face = gen_prev_faces; 00031 00032 prev_faces.resize(segs.size()); 00033 00034 for(unsigned long i = 0; i < segs.size(); ++i){ 00035 00036 if(segs[i].f()) prev_faces[i] = segs[i].f()->index(); 00037 00038 } 00039 00040 } 00041 00042 } 00043 00044 int 00045 ZCrossPreviousFaceGenerator::gen_prev_faces(ZCrossPreviousFaceGenerator *self) 00046 { 00047 00048 int val = -1; 00049 00050 if(!self->prev_faces.empty()){ 00051 00052 val = self->prev_faces.back(); 00053 self->prev_faces.pop_back(); 00054 00055 } 00056 00057 return val; 00058 00059 }