Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

zxsils_texture.H

Go to the documentation of this file.
00001 /**********************************************************************
00002  * sils_texture.H:
00003  **********************************************************************/
00004 #ifndef ZXSILS_TEXTURE_H_IS_INCLUDED
00005 #define ZXSILS_TEXTURE_H_IS_INCLUDED
00006 
00007 #include "color_id_texture.H"
00008 
00009 
00010 /**********************************************************************
00011  * ZcrossTexture:
00012  *
00013  *      Draws silhouette edges as GL line strips.
00014  **********************************************************************/
00015 class ZcrossTexture : public OGLTexture {
00016  public:
00017    //******** MANAGERS ********
00018    ZcrossTexture(Patch* patch = 0) :
00019       OGLTexture(patch),
00020       _color(0,0,0), // XXX g++ 2.97 work around
00021       _width(2) {}
00022 
00023    //******** RUN-TIME TYPE ID ********
00024    DEFINE_RTTI_METHODS2("Zcross Sils", GTexture, CDATA_ITEM *);
00025 
00026    //******** ACCESSORS ********
00027    GLfloat width()              const   { return _width; }
00028    void set_width(GLfloat w)            { _width = w; }
00029 
00030    CCOLOR&      color()         const   { return _color; }
00031 
00032    //******** GTexture METHODS ********
00033    virtual int  set_color(CCOLOR& c)            { _color = c; return 1; }
00034    virtual bool draws_filled()          const   { return false; }
00035    virtual int  draw(CVIEWptr& v); 
00036 
00037    //******** RefImageClient METHODS ********
00038    virtual int draw_vis_ref() {
00039       // You can pick what you can see ... for SilsTexture you see
00040       // silhouettes, so that's what we draw into the visibility
00041       // reference image:
00042       return ColorIDTexture::draw_edges(&_patch->cur_sils(), 3.0);
00043    }
00044 
00045    //******** DATA_ITEM METHODS ********
00046    virtual DATA_ITEM  *dup() const { return new ZcrossTexture; }
00047 
00048  protected:
00049    COLOR                _color;         // color of sils
00050    GLfloat              _width;         // width of them
00051 };
00052 
00053 #endif // ZXSILS_TEXTURE_H_IS_INCLUDED
00054 
00055 /* end of file sils_texture.H */

Generated on Mon Sep 18 11:39:34 2006 for jot by  doxygen 1.4.4