00001 /********************************************************************** 00002 * sils_texture.H: 00003 **********************************************************************/ 00004 #ifndef SILS_TEXTURE_H_IS_INCLUDED 00005 #define SILS_TEXTURE_H_IS_INCLUDED 00006 00007 #include "color_id_texture.H" 00008 00009 /********************************************************************** 00010 * SilsTexture: 00011 * 00012 * Draws silhouette edges as GL line strips. 00013 **********************************************************************/ 00014 class SilsTexture : public OGLTexture { 00015 public: 00016 //******** MANAGERS ******** 00017 SilsTexture(Patch* patch = 0) : 00018 OGLTexture(patch), 00019 _color(0,0,0), // XXX g++ 2.97 work around 00020 _width(2), 00021 _draw_borders(true) {} 00022 00023 //******** RUN-TIME TYPE ID ******** 00024 00025 DEFINE_RTTI_METHODS3("Sils", SilsTexture*, OGLTexture, CDATA_ITEM *); 00026 00027 //******** ACCESSORS ******** 00028 00029 GLfloat width() const { return _width; } 00030 void set_width(GLfloat w) { _width = w; } 00031 00032 CCOLOR& color() const { return _color; } 00033 00034 bool draw_borders() const { return _draw_borders; } 00035 void set_draw_borders(bool b) { _draw_borders = b; } 00036 00037 //******** GTexture METHODS ******** 00038 00039 virtual int set_color(CCOLOR& c) { _color = c; return 1; } 00040 virtual bool draws_filled() const { return false; } 00041 virtual int draw(CVIEWptr& v); 00042 00043 //******** RefImageClient METHODS ******** 00044 00045 virtual int draw_vis_ref(); 00046 00047 //******** DATA_ITEM METHODS ******** 00048 00049 virtual DATA_ITEM *dup() const { return new SilsTexture; } 00050 00051 protected: 00052 COLOR _color; // color of sils 00053 GLfloat _width; // width of them 00054 bool _draw_borders; // if true, draw borders and sils (default is true) 00055 }; 00056 00057 #endif // SILS_TEXTURE_H_IS_INCLUDED 00058 00059 /* end of file sils_texture.H */