00001 /********************************************************************** 00002 * sil_frame.H: 00003 **********************************************************************/ 00004 #ifndef ZXSIL_FRAME_H_IS_INCLUDED 00005 #define ZXSIL_FRAME_H_IS_INCLUDED 00006 00007 #include "zxsils_texture.H" 00008 #include "creases_texture.H" 00009 00010 /********************************************************************** 00011 * SilFrameTexture: 00012 **********************************************************************/ 00013 class ZcrossFrameTexture : public OGLTexture { 00014 public: 00015 //******** MANAGERS ******** 00016 ZcrossFrameTexture(Patch* patch = 0) : 00017 OGLTexture(patch), 00018 _creases(new CreasesTexture(patch)), 00019 _zxsils(new ZcrossTexture(patch)) {} 00020 00021 virtual ~ZcrossFrameTexture() { gtextures().delete_all(); } 00022 00023 //******** RUN-TIME TYPE ID ******** 00024 DEFINE_RTTI_METHODS2("ZX Sil Frame", OGLTexture, CDATA_ITEM *); 00025 00026 //******** ACCESSORS ******** 00027 void set_sil_width(GLfloat w) { _zxsils->set_width(w); } 00028 void set_sil_color(CCOLOR& c) { _zxsils->set_color(c); } 00029 void set_crease_width(GLfloat w) { _creases->set_width(w); } 00030 void set_crease_color(CCOLOR& c) { _creases->set_color(c); } 00031 00032 //******** GTexture METHODS ******** 00033 00034 virtual GTexture_list gtextures() const { 00035 return GTexture_list(_creases, _zxsils); 00036 } 00037 00038 virtual int set_color(CCOLOR& c) { 00039 set_sil_color(c); 00040 set_crease_color((c * 0.9) + (COLOR::white * 0.1)); 00041 return 1; 00042 } 00043 00044 virtual bool draws_filled() const { return false; } 00045 00046 virtual int draw(CVIEWptr& v) { 00047 if (_ctrl) 00048 return _ctrl->draw(v); 00049 _creases->draw(v); 00050 _zxsils->draw(v); 00051 00052 return 1; 00053 } 00054 00055 //******** RefImageClient METHODS ******** 00056 virtual int draw_vis_ref() { 00057 // XXX - draw creases? 00058 return _zxsils->draw_vis_ref(); 00059 } 00060 00061 //******** DATA_ITEM METHODS ******** 00062 virtual DATA_ITEM *dup() const { return new ZcrossFrameTexture; } 00063 00064 protected: 00065 CreasesTexture* _creases; 00066 ZcrossTexture* _zxsils; 00067 }; 00068 00069 #endif // ZXSIL_FRAME_H_IS_INCLUDED 00070 00071 /* end of file sil_frame.H */