00001 // @(#)root/table:$Id: TTablePoints.cxx 34911 2010-08-20 18:34:34Z pcanal $ 00002 // Author: Valery Fine 14/05/99 (E-mail: fine@bnl.gov) 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 00012 #include "TTablePoints.h" 00013 00014 /////////////////////////////////////////////////////////////////////////////////////// 00015 // // 00016 // Defines the TTable as an element of "event" geometry // 00017 // // 00018 // +SEQ,TTablePoints. // 00019 // +SEQ,T<your_table_name_here>. // 00020 // // 00021 // class T<your_table_name_here>_Points : public TTablePoints // 00022 // { // 00023 // public: // 00024 // T<your_table_name_here>_Points(TTableSorter *sorter,const void *key,Option_t *opt): 00025 // TTablePoints(sorter,key,opt){} // 00026 // virtual ~T<your_table_name_here>_Points(){} // default destructor // 00027 // virtual Float_t GetX(Int_t indx) { return ((<your_table_name_here>_st *)fRows)[Indx(idx)]-> <x>;} // 00028 // virtual Float_t GetY(Int_t indx) { return ((<your_table_name_here>_st *)fRows)[Indx(idx)]-> <y>;} // 00029 // virtual Float_t GetZ(Int_t indx) { return ((<your_table_name_here>_st *)fRows)[Indx(idx)]-> <z>;} // 00030 // }; // 00031 // // 00032 /////////////////////////////////////////////////////////////////////////////////////// 00033 00034 ClassImp(TTablePoints) 00035 00036 //____________________________________________________________________________ 00037 TTablePoints::TTablePoints() 00038 { 00039 //to be documented 00040 fTableSorter = 0; 00041 fKey = 0; 00042 fFirstRow = -1; 00043 fSize = 0; 00044 fRows = 0; 00045 } 00046 00047 //____________________________________________________________________________ 00048 TTablePoints::TTablePoints(TTableSorter *sorter,const void *key,Option_t *opt) 00049 { 00050 //to be documented 00051 fTableSorter = 0; 00052 fKey = 0; 00053 fFirstRow = -1; 00054 fSize = 0; 00055 fRows = 0; 00056 if (sorter) { 00057 fTableSorter = sorter; 00058 fKey = key; 00059 fSize = sorter->CountKey(fKey,0,kTRUE,&fFirstRow); 00060 SetTablePointer(GetTable()); 00061 } 00062 SetOption(opt); 00063 } 00064 00065 //____________________________________________________________________________ 00066 TTablePoints::TTablePoints(TTableSorter *sorter, Int_t keyIndex,Option_t *opt) 00067 { 00068 //to be documented 00069 fTableSorter = 0; 00070 fKey = 0; 00071 fFirstRow = -1; 00072 fSize = 0; 00073 fRows = 0; 00074 if (sorter) { 00075 fTableSorter = sorter; 00076 fKey = sorter->GetKeyAddress(keyIndex); 00077 fSize = sorter->CountKey(fKey,keyIndex,kFALSE,&fFirstRow); 00078 SetTablePointer(GetTable()); 00079 } 00080 SetOption(opt); 00081 } 00082 00083 //______________________________________________________________________________ 00084 Int_t TTablePoints::DistancetoPrimitive(Int_t /*px*/, Int_t /*py*/) 00085 { 00086 //*-*-*-*-*-*-*Compute distance from point px,py to a 3-D points *-*-*-*-*-*-* 00087 //*-* ===================================================== 00088 //*-* 00089 //*-* Compute the closest distance of approach from point px,py to each segment 00090 //*-* of the polyline. 00091 //*-* Returns when the distance found is below DistanceMaximum. 00092 //*-* The distance is computed in pixels units. 00093 //*-* 00094 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* 00095 return -1; 00096 }