00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef SH_EDGE_H
00022 #define SH_EDGE_H
00023
00024 #include "SampleValue.h"
00025 #include "Vertex.h"
00026 #include "common.h"
00027
00028 class Edge {
00029 public:
00033 Edge (void)
00034 : Vertex1(NULL), Index1(0), Vertex2(NULL), Index2(0), Weight(UWORD32_MAX) {} ;
00035
00039 Edge (Vertex *v1, unsigned short idx1, Vertex *v2, unsigned short idx2) ;
00040
00044 Edge (const Edge& e) ;
00045
00046 Vertex *getVertex1 (void) const
00047 { return Vertex1 ; } ;
00048
00049 void setVertex1 (Vertex* v)
00050 { Vertex1 = v ; } ;
00051
00052 Vertex *getVertex2 (void) const
00053 { return Vertex2 ; } ;
00054
00055 unsigned short getIndex1 (void) const
00056 { return Index1 ; } ;
00057
00058 void setIndex1 (unsigned short i)
00059 { Index1 = i ; } ;
00060
00061 unsigned short getIndex2 (void) const
00062 { return Index2 ; } ;
00063
00064 UWORD32 getWeight (void) ;
00065
00066 void set (Vertex* v1, unsigned short idx1, Vertex* v2, unsigned short idx2) ;
00067
00068 void set1 (Vertex* v1, unsigned short idx1) ;
00069
00070 void set2 (Vertex* v2, unsigned short idx2) ;
00071
00072 bool operator== (const Edge& e) const ;
00073
00074 bool operator!= (const Edge& e) const ;
00075
00079 void swap (void) ;
00080
00084 bool contains (const Vertex *v) const ;
00085
00089 Vertex *getOtherVertex (const Vertex *v) const ;
00090
00094 SamplePos getSamplePos (Vertex* v) const ;
00095
00099 SampleValue *getOriginalSampleValue (Vertex *v) const ;
00100
00104 SampleValue *getReplacingSampleValue (Vertex *v) const ;
00105
00106 void print (unsigned short spc = 0) const ;
00107
00108 private:
00109 Vertex *Vertex1 ;
00111 unsigned short Index1 ;
00112
00113 Vertex *Vertex2 ;
00115 unsigned short Index2 ;
00116
00117 UWORD32 Weight ;
00118 } ;
00119
00120 #endif // ndef SH_EDGE_H