00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Jeff Lait 00008 * Side Effects Software Inc 00009 * 477 Richmond Street West 00010 * Toronto, Ontario 00011 * Canada M5V 3E7 00012 * 416-504-9876 00013 * 00014 * NAME: GEO_PrimTriStrip.h ( GEO Library, C++) 00015 * 00016 * COMMENTS: Implements a normal triangle strip. 00017 */ 00018 00019 #ifndef __GEO_PrimTriStrip__ 00020 #define __GEO_PrimTriStrip__ 00021 00022 #include "GEO_API.h" 00023 #include "GEO_TriMesh.h" 00024 #include "GEO_PrimType.h" 00025 00026 class GEO_Point; 00027 class GEO_Detail; 00028 00029 class GEO_API GEO_PrimTriStrip : public GEO_TriMesh 00030 { 00031 public: 00032 GEO_PrimTriStrip(GEO_Detail *d) : GEO_TriMesh(d) { } 00033 ~GEO_PrimTriStrip(); 00034 00035 virtual unsigned getPrimitiveId() const; 00036 virtual int isDegenerate() const; 00037 virtual UT_Vector3 computeNormal() const; 00038 virtual void reverse(); 00039 virtual void reverseNormal(); 00040 00041 virtual float calcVolume(UT_Vector3 &refpt) const; 00042 virtual float calcArea() const; 00043 virtual float calcPerimeter() const; 00044 00045 int getTriangleCount() { return getVertexCount()-2; } 00046 void getTriangleVertices(int idx, 00047 int &v0, int &v1, int &v2) 00048 { 00049 v0 = idx; 00050 if (idx & 1) 00051 { 00052 v1 = idx+1; 00053 v2 = idx+2; 00054 } 00055 else 00056 { 00057 v1 = idx+2; 00058 v2 = idx+1; 00059 } 00060 } 00061 00062 protected: 00063 // We don't need to save anything other than what's in a face 00064 virtual int savePrivate(ostream &, int binary) const; 00065 virtual bool loadPrivate(UT_IStream &); 00066 00067 private: 00068 friend ostream &operator<<(ostream &os, const GEO_PrimTriStrip &d) 00069 { 00070 d.save(os, 0); 00071 return os; 00072 } 00073 }; 00074 00075 #endif 00076
1.5.9