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

DCVertex< T > Class Template Reference

#include <DCVertex.h>

List of all members.

Public Member Functions

 DCVertex ()
 DCVertex (T *idata, DCVertex< T > *nextVert)
virtual ~DCVertex ()
T * GetData ()
DCVertex< T > * GetNextVertex ()
DCEdge< T > * GetFirstEdge ()
void ResetNextVertex (DCVertex< T > *newvert)
void ResetFirstEdge (DCEdge< T > *newedge)
virtual void Print (Option_t *t="") const
void PrintEdges ()
void PrintGraph ()
float ConnectTo (DCVertex< T > *)
virtual void Draw (Option_t *t="")
void DrawEdges (Option_t *t="")
void DrawGraph (Option_t *t="")
void ClearConnections ()

Private Attributes

T * data
DCEdge< T > * edges
DCVertex< T > * next

template<class T>
class DCVertex< T >


Constructor & Destructor Documentation

template<class T>
DCVertex< T >::DCVertex  )  [inline]
 

Definition at line 29 of file DCVertex.h.

References DCVertex< T >::data, DCVertex< T >::edges, and DCVertex< T >::next.

00029 {data=0; edges=0; next=0;}

template<class T>
DCVertex< T >::DCVertex T *  idata,
DCVertex< T > *  nextVert
[inline]
 

Definition at line 30 of file DCVertex.h.

References DCVertex< T >::data, DCVertex< T >::edges, and DCVertex< T >::next.

00030 { data=new T(*idata); next=nextVert; edges=0;}

template<class T>
virtual DCVertex< T >::~DCVertex  )  [inline, virtual]
 

Definition at line 32 of file DCVertex.h.

References DCVertex< T >::data, DCVertex< T >::edges, and DCVertex< T >::next.

00032                       { 
00033       if(data!=0){delete data; data=0;}
00034       if(next!=0){delete next; next=0;}
00035       if(edges!=0){delete edges; edges=0;}
00036    }


Member Function Documentation

template<class T>
void DCVertex< T >::ClearConnections  ) 
 

Definition at line 144 of file DCVertex.h.

References DCVertex< T >::edges.

00145 {
00146    edges=0;
00147 }

template<class T>
float DCVertex< T >::ConnectTo DCVertex< T > *   ) 
 

Definition at line 123 of file DCVertex.h.

References DCVertex< T >::data, DCVertex< T >::GetData(), and DCEdge< T >::GetMetric().

Referenced by DCGraph< T >::AddEdge().

00124 {
00125 //   cout<<"In DCVertex::ConnectTo"<<endl;
00126   // allocate memory for a new Edge, set its Vertex pointer to point 
00127   // to Vert, and its Edge pointer to point to the rest of edges 
00128    T minus = (*(Vert->GetData()))-(*data);
00129    float m=(*data-*(Vert->GetData())).abs();
00130    float xm=0.;
00131    float ym=0.; 
00132    float zm=0.;
00133    minus.GetData(xm,ym,zm);
00134    float wm = m*zm;
00135    float xwm=xm*zm;
00136    float ywm=ym*zm;
00137    DCEdge<T> *newEdge = new DCEdge<T>(Vert, edges, m, xm, ym, wm, xwm, ywm);
00138    
00139    // make the new edge the first edge of the vertex
00140    edges = newEdge; 
00141    return newEdge->GetMetric();
00142 }

template<class T>
void DCVertex< T >::Draw Option_t *  t = ""  )  [virtual]
 

Definition at line 89 of file DCVertex.h.

References DCVertex< T >::data.

Referenced by DCEdge< T >::DrawThisEdge().

00090 {
00091 //   cout<<"in DCVertex::Draw on ";
00092 //   data->Print();
00093 //   cout<<endl;
00094    data->Draw(t);
00095 }

template<class T>
void DCVertex< T >::DrawEdges Option_t *  t = ""  ) 
 

Definition at line 97 of file DCVertex.h.

References DCVertex< T >::data, DCEdge< T >::DrawThisEdge(), and DCVertex< T >::edges.

Referenced by DCVertex< T >::DrawGraph().

00098 {
00099 //   cout<<"In DCVertex::DrawEdges "<<endl;
00100    data->Draw(t);
00101    if(edges!=0){
00102       edges->DrawThisEdge(this,t);
00103    }
00104 }

template<class T>
void DCVertex< T >::DrawGraph Option_t *  t = ""  ) 
 

Definition at line 106 of file DCVertex.h.

References DCVertex< T >::DrawEdges(), and DCVertex< T >::next.

Referenced by DCGraph< T >::Draw().

00107 {
00108 //   cout<<"In DCVertex::DrawGraph"<<endl;
00109    DrawEdges(t);
00110    if (next != 0){
00111 //      cout<<"Drawing next vertex"<<endl;
00112       next->DrawGraph(t);
00113    }  
00114 }

template<class T>
T* DCVertex< T >::GetData  )  [inline]
 

Definition at line 38 of file DCVertex.h.

Referenced by DCGraph< T >::AddClosestNode(), ClassImpT(), DCGraph< T >::Complement(), DCVertex< T >::ConnectTo(), DCGraph< T >::Draw(), DCEdge< T >::DrawThisEdge(), DCGraph< T >::FindMinSpan(), DCGraph< T >::GetAllZ(), DCGraph< T >::GetSummedZ(), MSTCalcAna::GraphLoop(), and DCGraph< T >::GraphMaxHits().

00038 {return data;}

template<class T>
DCEdge<T>* DCVertex< T >::GetFirstEdge  )  [inline]
 

Definition at line 40 of file DCVertex.h.

Referenced by DCGraph< T >::AddEdge(), DCGraph< T >::GetAllWeights(), and MSTCalcAna::GraphLoop().

00040 {return edges;}

template<class T>
DCVertex<T>* DCVertex< T >::GetNextVertex  )  [inline]
 

Definition at line 39 of file DCVertex.h.

Referenced by DCGraph< T >::AddClosestNode(), ClassImpT(), DCGraph< T >::Complement(), DCGraph< T >::Draw(), DCGraph< T >::GetAllWeights(), DCGraph< T >::GetAllZ(), DCGraph< T >::GetSummedZ(), MSTCalcAna::GraphLoop(), and DCGraph< T >::GraphMaxHits().

00039 {return next;}

template<class T>
void DCVertex< T >::Print Option_t *  t = ""  )  const [virtual]
 

Definition at line 117 of file DCVertex.h.

References DCVertex< T >::data, and DCEdge< T >::Print().

00118 {
00119    data->Print(t);
00120 }

template<class T>
void DCVertex< T >::PrintEdges  ) 
 

Referenced by DCVertex< T >::PrintGraph().

template<class T>
void DCVertex< T >::PrintGraph  ) 
 

Definition at line 81 of file DCVertex.h.

References DCVertex< T >::next, and DCVertex< T >::PrintEdges().

Referenced by DCGraph< T >::Print().

00082 {
00083    PrintEdges();
00084    if (next != 0){
00085       next->PrintGraph();
00086    }
00087 }

template<class T>
void DCVertex< T >::ResetFirstEdge DCEdge< T > *  newedge  )  [inline]
 

Definition at line 42 of file DCVertex.h.

References DCVertex< T >::edges.

00042 { edges=newedge;}

template<class T>
void DCVertex< T >::ResetNextVertex DCVertex< T > *  newvert  )  [inline]
 

Definition at line 41 of file DCVertex.h.

References DCVertex< T >::next.

00041 { next=newvert;}


Member Data Documentation

template<class T>
T* DCVertex< T >::data [private]
 

Definition at line 54 of file DCVertex.h.

Referenced by DCVertex< T >::ConnectTo(), DCVertex< T >::DCVertex(), DCVertex< T >::Draw(), DCVertex< T >::DrawEdges(), DCVertex< T >::Print(), and DCVertex< T >::~DCVertex().

template<class T>
DCEdge<T>* DCVertex< T >::edges [private]
 

Definition at line 55 of file DCVertex.h.

Referenced by DCVertex< T >::ClearConnections(), DCVertex< T >::DCVertex(), DCVertex< T >::DrawEdges(), DCVertex< T >::ResetFirstEdge(), and DCVertex< T >::~DCVertex().

template<class T>
DCVertex<T>* DCVertex< T >::next [private]
 

Definition at line 56 of file DCVertex.h.

Referenced by DCVertex< T >::DCVertex(), DCVertex< T >::DrawGraph(), DCVertex< T >::PrintGraph(), DCVertex< T >::ResetNextVertex(), and DCVertex< T >::~DCVertex().


The documentation for this class was generated from the following file:
Generated on Mon Feb 15 11:09:06 2010 for loon by  doxygen 1.3.9.1