00001
00002
00003 #ifndef __RECON_H
00004 #define __RECON_H 1
00005
00006 #include "reconstruction/LbldData.h"
00007 #include <iostream>
00008 #include <list>
00009
00010 class ReconVisitor;
00011 namespace gui { class DisplayRep; }
00012
00013 class Recon;
00014 typedef std::list<Recon *> ReconList;
00015 typedef std::list<Recon *>::iterator ReconListIterator;
00016 typedef std::list<Recon *>::const_iterator ReconListConstIterator;
00017
00018
00019
00020 class Recon
00021 {
00022 public:
00023
00024 enum ReconState {RESET, DONE, FAIL};
00025
00026 Recon ();
00027
00028 Recon (Recon* prnt);
00029
00030 virtual ~Recon ();
00031
00032
00033 virtual Recon& addRecon (Recon* nextRecon);
00034
00035 virtual Recon& removeRecon (Recon* oldRecon);
00036
00037 Recon& setParent (Recon* rc)
00038 {
00039 _parent = rc; return *this;
00040 }
00041
00042 void deleteRecons ();
00043
00044 virtual const char* nameOf () const
00045 {
00046 return "Recon";
00047 }
00048
00049 Recon& setTitle (const char* newTitle);
00050
00051 const char* title () const
00052 {
00053 return _title? _title : "no title";
00054 }
00055
00056 virtual void clear ();
00057
00058 virtual void accept (ReconVisitor& a);
00059
00060 virtual void readData (std::istream& is);
00061
00062 virtual void writeData (std::ostream& os);
00063
00064 enum Recon::ReconState state () const
00065 {
00066 return _state;
00067 }
00068
00069 void setState (enum Recon::ReconState s)
00070 {
00071 _state = s;
00072 }
00073
00074
00075 virtual void printOn (std::ostream& os = std::cout) const;
00076
00078 gui::DisplayRep* displayRep();
00079
00081 virtual void draw (gui::DisplayRep& v);
00082
00083
00084
00085 LbldData data;
00086
00087 int & mode(){return s_mode;}
00088 private:
00089
00090 class Rep;
00091 char* _title;
00092 enum Recon::ReconState _state;
00093
00094 Recon *_parent;
00095 ReconList _reconList;
00096
00097 static int s_mode;
00098 };
00099
00100 #endif