Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

ISTriStrip.H

Go to the documentation of this file.
00001 
00009 #ifndef TRISTRIP_H
00010 #define TRISTRIP_H
00011 
00012 
00013 // Gluebase includes
00014 #define OUTSIDE_GLUE_CORE
00015 #include <std/hash.H>
00016 
00017 
00018 #include "ISVertex.H"
00019 
00020 class ISMesh;
00021 
00022 
00023 class TriStrip
00024 {
00025  public:
00026   TriStrip(ISMesh *m) {
00027     _mesh = m;
00028   }
00029   
00030   virtual ~TriStrip() {}
00031 
00032   void addVertex(ISVertex *v) {
00033     _verts += v;
00034   }
00035 
00036   ISVertex* lastVert() {
00037     if (_verts.num() >= 1)
00038       return _verts[_verts.num()-1];
00039     return NULL;
00040   }
00041 
00042   ISVertex* lastLastVert() {
00043     if (_verts.num() >= 2)
00044       return _verts[_verts.num()-2];
00045     return NULL;
00046   }
00047   
00048   int numVerts() { return _verts.num(); }
00049 
00050   ISVertex* vertex(int n) {
00051     if ((n>=0) && (n < _verts.num()))
00052       return _verts[n];
00053     else {
00054       cerr << "TriStrip Error: vertex index out of range." << endl;
00055       return NULL;
00056     }
00057   }
00058 
00059  protected:  
00060   ISMesh *_mesh;
00061 
00062   ARRAY<ISVertex*> _verts;
00063 };
00064 
00065 #endif
00066 
00067 
00068 

Generated on Mon Sep 15 16:27:56 2003 for inspace by doxygen1.2.18