StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TTablePoints.cxx
1 // @(#)root/table:$Id$
2 // Author: Valery Fine 14/05/99 (E-mail: fine@bnl.gov)
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #include "TTablePoints.h"
13 
15 // //
16 // Defines the TTable as an element of "event" geometry //
17 // //
18 // +SEQ,TTablePoints. //
19 // +SEQ,T<your_table_name_here>. //
20 // //
21 // class T<your_table_name_here>_Points : public TTablePoints //
22 // { //
23 // public: //
24 // T<your_table_name_here>_Points(TTableSorter *sorter,const void *key,Option_t *opt):
25 // TTablePoints(sorter,key,opt){} //
26 // virtual ~T<your_table_name_here>_Points(){} // default destructor //
27 // virtual Float_t GetX(Int_t indx) { return ((<your_table_name_here>_st *)fRows)[Indx(idx)]-> <x>;} //
28 // virtual Float_t GetY(Int_t indx) { return ((<your_table_name_here>_st *)fRows)[Indx(idx)]-> <y>;} //
29 // virtual Float_t GetZ(Int_t indx) { return ((<your_table_name_here>_st *)fRows)[Indx(idx)]-> <z>;} //
30 // }; //
31 // //
33 
34 // Pin vtable
35 void TTablePoints::SetTablePointer(void *table)
36 {
37  fRows = table;
38 }
39 
40 ClassImp(TTablePoints);
41 
44 
46 {
47  fTableSorter = 0;
48  fKey = 0;
49  fFirstRow = -1;
50  fSize = 0;
51  fRows = 0;
52 }
53 
56 
57 TTablePoints::TTablePoints(TTableSorter *sorter,const void *key,Option_t *opt)
58 {
59  fTableSorter = 0;
60  fKey = 0;
61  fFirstRow = -1;
62  fSize = 0;
63  fRows = 0;
64  if (sorter) {
65  fTableSorter = sorter;
66  fKey = key;
67  fSize = sorter->CountKey(fKey,0,kTRUE,&fFirstRow);
68  SetTablePointer(GetTable());
69  }
70  SetOption(opt);
71 }
72 
75 
76 TTablePoints::TTablePoints(TTableSorter *sorter, Int_t keyIndex,Option_t *opt)
77 {
78  fTableSorter = 0;
79  fKey = 0;
80  fFirstRow = -1;
81  fSize = 0;
82  fRows = 0;
83  if (sorter) {
84  fTableSorter = sorter;
85  fKey = sorter->GetKeyAddress(keyIndex);
86  fSize = sorter->CountKey(fKey,keyIndex,kFALSE,&fFirstRow);
87  SetTablePointer(GetTable());
88  }
89  SetOption(opt);
90 }
91 
99 
100 Int_t TTablePoints::DistancetoPrimitive(Int_t /*px*/, Int_t /*py*/)
101 {
102  return -1;
103 }
TTablePoints()
to be documented
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
virtual Int_t CountKey(const void *key, Int_t firstIndx=0, Bool_t bSearch=kTRUE, Int_t *firstRow=0) const