00001 /***************************************************************** 00002 * buffer_ref_image.H 00003 *****************************************************************/ 00004 #ifndef AUX_REF_IMAGE_HEADER 00005 #define AUX_REF_IMAGE_HEADER 00006 00007 #include "std/support.H" 00008 #include "geom/image.H" 00009 #include "gtex/ref_image.H" 00010 00011 /********************************************************************** 00012 * AUX_JOB: 00013 * 00014 * I'll fill this in when I decide how this works... 00015 * 00016 **********************************************************************/ 00017 00018 MAKE_PTR_BASEC(AUX_JOB); 00019 #define CAUX_JOBptr const AUX_JOBptr 00020 00021 class AUX_JOB : public REFcounter { 00022 00023 protected: 00024 00025 int _w; 00026 int _h; 00027 bool _dirty; 00028 GELlist _list; 00029 Image _img; 00030 00031 public: 00032 00033 AUX_JOB() : _w(0), _h(0), _dirty(false) {} 00034 virtual ~AUX_JOB() {} 00035 00036 void add (CGELptr &g) { _list.add(g); } 00037 bool rem (CGELptr &g) { return _list.rem(g); } 00038 CGELlist& list () { return _list; } 00039 00040 void set_dirty() { _dirty = true; } 00041 void clear_dirty() { _dirty = false; } 00042 bool is_dirty() { return _dirty; } 00043 00044 void set_size(int w, int h) { if((w>0)&&(h>0)){_w=w;_h=h;_img.resize(w,h,3);}} 00045 int width() { return _w; } 00046 int height() { return _h; } 00047 00048 Image& image() { return _img; } 00049 00050 virtual bool needs_update() { return ((_w>0)&&(_h>0)&&is_dirty()&&(_list.num()>0)); } 00051 00052 virtual void updated() { _dirty = false; } 00053 00054 }; 00055 00056 #define CAUX_JOBlist const AUX_JOBlist 00057 class AUX_JOBlist : public LIST<AUX_JOBptr> { 00058 public : 00059 AUX_JOBlist(int num=16) : LIST<AUX_JOBptr>(num) { } 00060 AUX_JOBlist(CAUX_JOBptr &g) { add(g); } 00061 }; 00062 00063 /********************************************************************** 00064 * AuxRefImage: 00065 * 00066 * I'll fill this in when I decide how this works... 00067 * 00068 **********************************************************************/ 00069 00070 #define CAuxRefImage const AuxRefImage 00071 00072 class AuxRefImage : public RefImage { 00073 00074 protected: 00075 00076 static HASH _hash; 00077 00078 AUX_JOBlist _list; 00079 CAMptr _cam; 00080 00081 public: 00082 00083 virtual ~AuxRefImage() {} 00084 00085 static AuxRefImage* lookup(CVIEWptr& v); 00086 00087 virtual void update(); 00088 virtual void draw_objects(CGELlist&) const; 00089 00090 void add(CAUX_JOBptr &j) { _list.add(j); } 00091 bool rem(CAUX_JOBptr &j) { return _list.rem(j); } 00092 00093 protected: 00094 00095 AuxRefImage(CVIEWptr& v); 00096 00097 bool needs_update(); 00098 00099 }; 00100 00101 #endif // AUX_REF_IMAGE_HEADER 00102 00103 /* end of file aux_ref_image.H */