ROOT logo
ROOT » MISC » TABLE » TTable3Points

class TTable3Points: public TTablePoints


   TTable3Points class is to create 3D view of any 3 columns of the TTable objects
   with one and the same "key column value".

   For example all values of the column "x[0]" "x[1]" "x[2]" of the 
g2t_tpc_hit
 table
   from the rows with one and same "track_id" column value will be regarded
   as an image of one and the same "track".
   The last means all those points will be painted with one and the same 3D
   attributes like "color", "size", "style", "light","markers", "connections"  etc.

   The original TTable object must be pre-sorted by "key column" via TTableSorter
   class

 void   CreatePoints(Tg2t_tpc_hit *points)
 {
   g2t_tpc_hit_st *p = points->GetTable();

  TTable3Points *track = 0;
  TString tr;
  tr = "track_p";
  TTable &ttt = *((TTable *)points);
  // Track2Line MUST be on heap otherwise 3D view will crash just code leaves this
  // subroutine
  We will assemble all points by its "track_p" field.

  TTableSorter *Track2Line = new TTableSorter (ttt,"track_p");

  Int_t i = 0;
  Char_t buffer[10];
  Int_t ntracks = 0;
  const Int_t maxtracks = 5;
---------------------------- Fill tracks -------------------
  long currentId = -1;
  long newId =  0;
  g2t_tpc_hit_st *hitPoint = 0;
  TVolume *thisTrack[7] = {0,0,0,0,0,0,0}; // seven volumes for 7 different colors
  Int_t  MaxRowtoCount = 5000; // 5000;
  Int_t  MaxTracks = Track2Line->CountKeys();
  MaxTracks = 100;
  for (i=0;i<Track2Line->GetNRows() && ntracks <  MaxTracks ;i++)
  {
   hitPoint = p + Track2Line->GetIndex(i);
   newId =  hitPoint->track_p;
   if (newId != currentId)  { // The hit for the new track has been found

     const Char_t *xName = "x[0]";
     const Char_t *yName = "x[1]";
     const Char_t *zName = "x[2]";

     track =  new TTable3Points(Track2Line,(const void *)&newId,xName,yName,zName);

     // Create a shape for this node
     TPolyLineShape *trackShape  =  new TPolyLineShape(track);
     trackShape->SetVisibility(1);
     Int_t colorIndx = ntracks%7;
     trackShape->SetColorAttribute(colorIndx+kGreen);
     trackShape->SetLineStyle(1);
     trackShape->SetSizeAttribute(2);
     // Create a node to hold it
     if (!thisTrack[colorIndx])  {
         thisTrack[colorIndx] = new TVolume("hits","hits",trackShape);
         thisTrack[colorIndx]->Mark();
         thisTrack[colorIndx]->SetVisibility();
         TVolumePosition *pp = hall->Add(thisTrack[colorIndx]);
         if (!pp) printf(" no position %d\n",ntrack);
     }
     else
       thisTrack[colorIndx]->Add(trackShape);
     currentId = newId;
     ntracks++;
   }
 }


Function Members (Methods)

public:
TTable3Points()
TTable3Points(const TTable3Points&)
TTable3Points(TTableSorter* sorter, const void* key, const Char_t* xName = "x", const Char_t* yName = "y", const Char_t* zName = "z", Option_t* opt = "")
TTable3Points(TTableSorter* sorter, Int_t keyIndex, const Char_t* xName = "x", const Char_t* yName = "y", const Char_t* zName = "z", Option_t* opt = "")
virtual~TTable3Points()
voidTObject::AbstractMethod(const char* method) const
virtual Int_tTPoints3DABC::Add(Float_t x, Float_t y, Float_t z)
virtual Int_tTPoints3DABC::AddLast(Float_t x, Float_t y, Float_t z)
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
static TClass*TTablePoints::Class()
static TClass*TPoints3DABC::Class()
static TClass*TObject::Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidTObject::Copy(TObject& object) const
virtual voidTObject::Delete(Option_t* option = "")MENU
static Int_tTPoints3DABC::DistancetoLine(Int_t px, Int_t py, Float_t x1, Float_t y1, Float_t x2, Float_t y2, Int_t lineWidth = 1)
virtual Int_tTTablePoints::DistancetoPrimitive(Int_t px, Int_t py)
virtual Int_tTPoints3DABC::DistancetoPrimitive(Int_t px, Int_t py)
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual Float_tGetAnyPoint(Int_t idx, TTable3Points::EPointDirection xAxis) const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
virtual Int_tGetKey(Int_t)
virtual Int_tTTablePoints::GetLastPosition() const
virtual Int_tTPoints3DABC::GetLastPosition() const
virtual Int_tGetN() const
virtual Int_tTPoints3DABC::GetN() const
virtual const char*TObject::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TTablePoints::GetOption() const
virtual Option_t*TPoints3DABC::GetOption() const
virtual Option_t*TObject::GetOption() const
virtual Float_t*GetP() const
virtual Float_t*TPoints3DABC::GetP() const
virtual void*TTablePoints::GetTable()
virtual const char*TObject::GetTitle() const
virtual Int_tGetTotalKeys()
virtual UInt_tTObject::GetUniqueID() const
virtual Float_tGetX(Int_t idx) const
virtual Float_tTTablePoints::GetX(Int_t idx) const
virtual Float_tTPoints3DABC::GetX(Int_t idx) const
virtual const Float_t*GetXYZ(Int_t)
virtual const Float_t*TPoints3DABC::GetXYZ(Int_t idx)
virtual Float_t*GetXYZ(Float_t* xyz, Int_t idx, Int_t num = 1) const
virtual Float_t*TPoints3DABC::GetXYZ(Float_t* xyz, Int_t idx, Int_t num = 1) const
virtual Float_tGetY(Int_t idx) const
virtual Float_tTTablePoints::GetY(Int_t idx) const
virtual Float_tTPoints3DABC::GetY(Int_t idx) const
virtual Float_tGetZ(Int_t idx) const
virtual Float_tTTablePoints::GetZ(Int_t idx) const
virtual Float_tTPoints3DABC::GetZ(Int_t idx) const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual Int_tTTablePoints::Indx(Int_t sortedIndx) const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual TClass*TTablePoints::IsA() const
virtual TClass*TPoints3DABC::IsA() const
virtual TClass*TObject::IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTObject::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TPoints3DABC&TPoints3DABC::operator=(const TPoints3DABC&)
TObject&TObject::operator=(const TObject& rhs)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidPaintPoints(int, float*, const char*)
virtual voidTObject::Pop()
virtual voidTObject::Print(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "")
virtual voidSetAnyColumn(const Char_t* anyName, TTable3Points::EPointDirection indx)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
virtual Int_tSetKeyByIndx(Int_t)
virtual Int_tSetKeyByValue(Int_t)
virtual Int_tTTablePoints::SetLastPosition(Int_t idx)
virtual Int_tTPoints3DABC::SetLastPosition(Int_t idx)
virtual Int_tTPoints3DABC::SetNextPoint(Float_t x, Float_t y, Float_t z)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidTTablePoints::SetOption(Option_t*)
virtual voidTPoints3DABC::SetOption(Option_t* option = "")
virtual Int_tTTablePoints::SetPoint(Int_t, Float_t, Float_t, Float_t)
virtual Int_tTPoints3DABC::SetPoint(Int_t point, Float_t x, Float_t y, Float_t z)
virtual Int_tTTablePoints::SetPoints(Int_t, Float_t*, Option_t*)
virtual Int_tTPoints3DABC::SetPoints(Int_t n, Float_t* p = 0, Option_t* option = "")
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidSetXColumn(const Char_t* xName)
virtual voidSetYColumn(const Char_t* yName)
virtual voidSetZColumn(const Char_t* zName)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual voidTTablePoints::ShowMembers(TMemberInspector& insp, char* parent)
virtual voidTPoints3DABC::ShowMembers(TMemberInspector& insp, char* parent)
virtual voidTObject::ShowMembers(TMemberInspector& insp, char* parent)
virtual Int_tTTablePoints::Size() const
virtual Int_tTPoints3DABC::Size() const
virtual voidStreamer(TBuffer& b)
virtual voidTTablePoints::Streamer(TBuffer& b)
virtual voidTPoints3DABC::Streamer(TBuffer& b)
virtual voidTObject::Streamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
voidTTablePoints::StreamerNVirtual(TBuffer& b)
voidTPoints3DABC::StreamerNVirtual(TBuffer& b)
voidTObject::StreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()
virtual voidTTablePoints::SetTablePointer(void* table)

Data Members

private:
enum EPointDirection { kXPoints
kYPoints
kZPoints
kTotalSize
};
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
protected:
ULong_t*fColumnOffset!
Int_tTTablePoints::fFirstRowThe first row to take in account
const void*TTablePoints::fKeypointer to key value to select rows
void*TTablePoints::fRowsPointer the first row of the STAF table
Int_tTTablePoints::fSize
TTableSorter*TTablePoints::fTableSorter

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TTable3Points()
to be documented
TTable3Points(TTableSorter *sorter,const void *key, const Char_t *xName, const Char_t *yName, const Char_t *zName ,Option_t *opt)
to be documented
TTable3Points(TTableSorter *sorter,Int_t keyIndex, const Char_t *xName, const Char_t *yName, const Char_t *zName ,Option_t *opt)
to be documented
~TTable3Points()
to be documented
Float_t GetAnyPoint(Int_t idx, TTable3Points::EPointDirection xAxis) const
to be documented
void SetAnyColumn(const Char_t* anyName, TTable3Points::EPointDirection indx)
to be documented
Float_t * GetXYZ(Float_t* xyz, Int_t idx, Int_t num = 1) const
to be documented
TTable3Points()
void SetXColumn(const Char_t* xName)
void SetYColumn(const Char_t* yName)
void SetZColumn(const Char_t* zName)
Int_t GetTotalKeys()
{ return -1;}
Int_t GetKey(Int_t )
{return -1;}
Int_t SetKeyByIndx(Int_t )
{return -1;}
Int_t SetKeyByValue(Int_t )
{return -1;}
Float_t GetX(Int_t idx) const
{return GetAnyPoint(idx,kXPoints);}
Float_t GetY(Int_t idx) const
{return GetAnyPoint(idx,kYPoints);}
Float_t GetZ(Int_t idx) const
-- abstract methods
{return GetAnyPoint(idx,kZPoints);}
void PaintPoints(int , float* , const char* )
{}
const Float_t * GetXYZ(Int_t )
{return 0;}
Float_t * GetP() const
{return 0;}
Int_t GetN() const
{return -1;}