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

vert_strip.H

Go to the documentation of this file.
00001 /**********************************************************************
00002  * vert_strip.H:
00003  **********************************************************************/
00004 #ifndef VERT_STRIP_H_IS_INCLUDED
00005 #define VERT_STRIP_H_IS_INCLUDED
00006 
00007 #include "bvert.H"
00008 
00009 class StripCB;
00010 /**********************************************************************
00011  * VertStrip:
00012  *
00013  *      Builds and stores vert strips -- sequences of mesh vertices
00014  *      that can be drawn, e.g. as OpenGL point strips. 
00015  *
00016  *      Like TriStrips and EdgeStrips, uses a StripCB for the actual
00017  *      graphics calls.
00018  **********************************************************************/
00019 #define CVertStrip const VertStrip
00020 class VertStrip {
00021  public:
00022    //******** MANAGERS ********
00023    VertStrip() : _patch(0), _index(-1) {}
00024    virtual ~VertStrip();
00025 
00026    //******** ACCESSORS ********
00027    CARRAY<Bvert*> &verts() const { return _verts;}
00028    Patch*          patch() const { return _patch; }
00029 
00030    Bvert* vert(int i)      const { return _verts[i]; }
00031 
00032    bool   empty()          const { return _verts.empty(); }
00033    int    num()            const { return _verts.num(); }
00034 
00035    //******** THE MAIN JOB ********
00036    virtual void draw(StripCB* cb);
00037 
00038    //******** BUILDING ********
00039    virtual void reset() { _verts.clear(); }
00040    void add(Bvert* v)   { _verts += v; }
00041 
00042  protected:
00043    friend class Patch;
00044 
00045    //******** DATA ********
00046    ARRAY<Bvert*>  _verts;       // the sequence of verts
00047    Patch*         _patch;       // patch this is assigned to
00048    int            _index;       // index in patch's list
00049 
00050    //******** PROTECTED METHODS ********
00051    // setting the Patch -- nobody's bizness but the Patch's:
00052    // (to set it call Patch::add(VertStrip*))
00053    void   set_patch(Patch* p)           { _patch = p; }
00054    void   set_patch_index(int k)        { _index = k; }
00055    int    patch_index() const           { return _index; }
00056 };
00057 
00058 #endif // VERT_STRIP_H_IS_INCLUDED
00059 
00060 /* end of file vert_strip.H */

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