ROOT
6.16/01
Reference Guide
misc
table
src
TTablePoints.cxx
Go to the documentation of this file.
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
14
///////////////////////////////////////////////////////////////////////////////////////
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
// //
32
///////////////////////////////////////////////////////////////////////////////////////
33
34
// Pin vtable
35
void
TTablePoints::SetTablePointer
(
void
*
table
)
36
{
37
fRows
=
table
;
38
}
39
40
ClassImp
(
TTablePoints
);
41
42
////////////////////////////////////////////////////////////////////////////////
43
///to be documented
44
45
TTablePoints::TTablePoints
()
46
{
47
fTableSorter
= 0;
48
fKey
= 0;
49
fFirstRow
= -1;
50
fSize
= 0;
51
fRows
= 0;
52
}
53
54
////////////////////////////////////////////////////////////////////////////////
55
///to be documented
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
73
////////////////////////////////////////////////////////////////////////////////
74
///to be documented
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
92
////////////////////////////////////////////////////////////////////////////////
93
/// Compute distance from point px,py to a 3-D points.
94
///
95
/// Compute the closest distance of approach from point px,py to each segment
96
/// of the polyline.
97
/// Returns when the distance found is below DistanceMaximum.
98
/// The distance is computed in pixels units.
99
100
Int_t
TTablePoints::DistancetoPrimitive
(
Int_t
/*px*/
,
Int_t
/*py*/
)
101
{
102
return
-1;
103
}
Int_t
int Int_t
Definition:
RtypesCore.h:41
kFALSE
const Bool_t kFALSE
Definition:
RtypesCore.h:88
kTRUE
const Bool_t kTRUE
Definition:
RtypesCore.h:87
Option_t
const char Option_t
Definition:
RtypesCore.h:62
ClassImp
#define ClassImp(name)
Definition:
Rtypes.h:363
TTablePoints.h
TTablePoints
Definition:
TTablePoints.h:20
TTablePoints::fSize
Int_t fSize
Definition:
TTablePoints.h:25
TTablePoints::GetTable
virtual void * GetTable()
Definition:
TTablePoints.h:56
TTablePoints::fFirstRow
Int_t fFirstRow
Definition:
TTablePoints.h:24
TTablePoints::fRows
void * fRows
Definition:
TTablePoints.h:26
TTablePoints::fTableSorter
TTableSorter * fTableSorter
Definition:
TTablePoints.h:22
TTablePoints::SetTablePointer
virtual void SetTablePointer(void *table)
Definition:
TTablePoints.cxx:35
TTablePoints::fKey
const void * fKey
Definition:
TTablePoints.h:23
TTablePoints::DistancetoPrimitive
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a 3-D points.
Definition:
TTablePoints.cxx:100
TTablePoints::TTablePoints
TTablePoints()
to be documented
Definition:
TTablePoints.cxx:45
TTablePoints::SetOption
virtual void SetOption(Option_t *)
Definition:
TTablePoints.h:43
TTableSorter
Definition:
TTableSorter.h:46
TTableSorter::GetKeyAddress
virtual const void * GetKeyAddress(Int_t indx)
Definition:
TTableSorter.h:172
TTableSorter::CountKey
virtual Int_t CountKey(const void *key, Int_t firstIndx=0, Bool_t bSearch=kTRUE, Int_t *firstRow=0) const
CountKey counts the number of rows with the key value equal "key".
Definition:
TTableSorter.cxx:692
table
void table()
Definition:
table.C:85