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 * George ElKoura 00008 * Side Effects 00009 * 477 Richmond Street West 00010 * Toronto, Ontario 00011 * Canada M5V 3E7 00012 * 416-504-9876 00013 * 00014 * NAME: Base class for an edge (C++) 00015 * 00016 * COMMENTS: 00017 * 00018 */ 00019 #ifndef __GB_Edge_h__ 00020 #define __GB_Edge_h__ 00021 00022 #include "GB_API.h" 00023 #include <UT/UT_LinkList.h> 00024 #include "GB_Element.h" 00025 00026 class GB_Detail; 00027 class UT_IStream; 00028 00029 class GB_API GB_Edge : public UT_LinkNode 00030 { 00031 public: 00032 00033 00034 GB_Edge(GB_Element *ppt0=0, GB_Element *ppt1=0, GB_Element *pprim=0); 00035 GB_Edge(const GB_Edge &e); 00036 00037 virtual ~GB_Edge(void); 00038 00039 GB_Edge &operator=(const GB_Edge &e) 00040 { 00041 myP0=e.myP0; 00042 myP1=e.myP1; 00043 myPrim=e.myPrim; 00044 return *this; 00045 } 00046 unsigned operator==(const GB_Edge &e); 00047 00048 const GB_Element *p0() const { return myP0; } 00049 GB_Element *&p0() { return myP0; } 00050 const GB_Element *p1() const { return myP1; } 00051 GB_Element *&p1() { return myP1; } 00052 const GB_Element *prim() const { return myPrim; } 00053 GB_Element *&prim() { return myPrim; } 00054 00055 00056 // I/O methods, returning 0 if OK and -1 otherwise: 00057 int save(ostream &os, int binary) const; 00058 bool load(UT_IStream &is, const GB_Detail &gdp); 00059 00060 protected: 00061 00062 // The two end-points 00063 GB_Element *myP0; 00064 GB_Element *myP1; 00065 00066 // Optional primitive to which this edge belongs 00067 GB_Element *myPrim; 00068 00069 private: 00070 friend class GB_Detail; 00071 }; 00072 00073 #endif
1.5.9