00001 /********************************************************************** 00002 * color_id_texture.H: 00003 **********************************************************************/ 00004 #ifndef COLOR_ID_TEXTURE_H_IS_INCLUDED 00005 #define COLOR_ID_TEXTURE_H_IS_INCLUDED 00006 00007 #include "solid_color.H" 00008 00009 /********************************************************************** 00010 * ColorIDStripCB: 00011 **********************************************************************/ 00012 class ColorIDStripCB : public GLStripCB { 00013 public: 00014 00015 virtual void faceCB(CBvert* v, CBface* f); 00016 virtual void edgeCB(CBvert* v, CBedge* e); 00017 virtual void vertCB(CBvert* v); 00018 }; 00019 00020 /********************************************************************** 00021 * ColorIDTexture: 00022 **********************************************************************/ 00023 class ColorIDTexture : public BasicTexture { 00024 protected: 00025 GLfloat _width; // used when drawing lines 00026 GLenum _polygon_mode; // filled or wireframe? 00027 SolidColorTexture* _black; // optional solid black texture 00028 00029 public: 00030 //******** MANAGERS ******** 00031 ColorIDTexture(Patch* patch = 0, GLenum pmode = GL_FILL); 00032 virtual ~ColorIDTexture() { gtextures().delete_all(); } 00033 00034 //******** RUN-TIME TYPE ID ******** 00035 DEFINE_RTTI_METHODS2("Color ID", BasicTexture, CDATA_ITEM *); 00036 00037 //******** ACCESSORS ******** 00038 00039 void set_polygon_mode(GLenum pmode) { _polygon_mode = pmode; changed(); } 00040 void set_width(GLfloat w) { _width = w; } 00041 00042 //******** VIRTUAL METHODS ******** 00043 00044 virtual GTexture_list gtextures() const { return GTexture_list(_black); } 00045 virtual int draw_black(CVIEWptr& v) { return _black->draw(v); } 00046 00047 //******** STATICS ******** 00048 static void push_gl_state(GLbitfield = 0); 00049 static int draw_edges(EdgeStrip*, GLfloat width, bool z_test=1); 00050 static int draw_verts(VertStrip*, GLfloat width, bool z_test=1); 00051 00052 //******** GTexture METHODS ******** 00053 virtual int draw(CVIEWptr& v); 00054 00055 //******** DATA_ITEM METHODS ******** 00056 virtual DATA_ITEM *dup() const { return new ColorIDTexture; } 00057 }; 00058 00059 #endif // COLOR_ID_TEXTURE_H_IS_INCLUDED 00060 00061 /* end of file color_id_texture.H */