00001 // Copyright (C) 2005-2008 Washington University in St Louis, Baylor College of Medicine. All rights reserved 00002 // Author: Tao Ju, Refactored by Sasakthi S. Abeysinghe (sasakthi@gmail.com) 00003 // Description: Grid queue 00004 00005 #ifndef SKELETON_MAKER_GRID_QUEUE_H 00006 #define SKELETON_MAKER_GRID_QUEUE_H 00007 00008 #include <cstdio> 00009 #include <cstdlib> 00010 using namespace std; 00011 00012 namespace wustl_mm { 00013 namespace SkeletonMaker { 00014 struct gridQueueEle 00015 { 00016 int x, y, z; 00017 int score ; 00018 gridQueueEle* next ; 00019 }; 00020 00021 class GridQueue 00022 { 00023 public: 00024 GridQueue(); 00025 gridQueueEle* getHead(); 00026 int getNumElements(); 00027 void sort(int eles); 00028 void pushQueue(int xx, int yy, int zz); 00029 int popQueue(int& xx, int& yy, int& zz); 00030 00031 00032 private: 00033 void swapEle(gridQueueEle* pre, gridQueueEle* e1, gridQueueEle* e2); 00034 private: 00035 gridQueueEle* head ; 00036 gridQueueEle* tail ; 00037 int numEles ; 00038 }; 00039 00040 } 00041 } 00042 #endif