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