ROOT  6.06/09
Reference Guide
TGLSelectRecord.h
Go to the documentation of this file.
1 // @(#)root/gl:$Id$
2 // Author: Matevz Tadel, Jun 2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2004, 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 #ifndef ROOT_TGLSelectRecord
13 #define ROOT_TGLSelectRecord
14 
15 #include <Rtypes.h>
16 
17 class TObject;
18 class TGLSceneInfo;
19 class TGLPhysicalShape;
20 class TGLLogicalShape;
21 class TGLOverlayElement;
22 
23 /**************************************************************************/
24 // TGLSelectRecordBase
25 /**************************************************************************/
26 
28 {
29 protected:
30  // Primary data - coming from GL.
35 
36  // Current position (for name resolutin in hierachies of unknown depth).
38 
39  void CopyItems(UInt_t* items);
40 
41 public:
45  virtual ~TGLSelectRecordBase();
46 
48 
49  void SetRawOnly(UInt_t* data);
50 
51  virtual void Set(UInt_t* data);
52  virtual void Reset();
53 
54  Int_t GetN() const { return fN; }
55  UInt_t* GetItems() const { return fItems; }
56  UInt_t GetItem(Int_t i) const { return fItems[i]; }
57  Float_t GetMinZ() const { return fMinZ; }
58  Float_t GetMaxZ() const { return fMaxZ; }
59 
60  UInt_t GetCurrItem() const { return fPos < fN ? fItems[fPos] : 0; }
61  Int_t GetNLeft() const { return fN - fPos; }
62  void NextPos() { ++fPos; }
63  void PrevPos() { --fPos; }
64  void ResetPos() { fPos = 0; }
65 
66  ClassDef(TGLSelectRecordBase, 0) // Base class for GL selection records.
67 };
68 
69 
70 /**************************************************************************/
71 // TGLSelectRecord
72 /**************************************************************************/
73 
75 {
76 public:
78 
79 protected:
80  // Secondary data (scene dependent) - use
81  // TGLSceneBase::ResolveSelectRecord() to fill.
83  TGLSceneInfo *fSceneInfo; // SceneInfo
84  TGLPhysicalShape *fPhysShape; // PhysicalShape, if applicable
85  TGLLogicalShape *fLogShape; // LogicalShape, if applicable
86  TObject *fObject; // Master TObject, if applicable
87  void *fSpecific; // Scene specific, if applicable
88  Bool_t fMultiple; // Mutliple selection requested (set by event-handler).
89  Bool_t fHighlight; // Requested for highlight (set by event-handler).
90 
91  ESecSelResult fSecSelRes; // Result of ProcessSelection;
92 
93 public:
95  TGLSelectRecord(UInt_t* data);
96  TGLSelectRecord(const TGLSelectRecord& rec);
97  virtual ~TGLSelectRecord();
98 
100 
101  virtual void Set(UInt_t* data);
102  virtual void Reset();
103 
104  Bool_t GetTransparent() const { return fTransparent; }
105  TGLSceneInfo * GetSceneInfo() const { return fSceneInfo; }
107  TGLLogicalShape * GetLogShape() const { return fLogShape; }
108  TObject * GetObject() const { return fObject; }
109  void * GetSpecific() const { return fSpecific; }
110  Bool_t GetMultiple() const { return fMultiple; }
111  Bool_t GetHighlight() const { return fHighlight; }
112 
114 
115  void SetTransparent(Bool_t t) { fTransparent = t; }
116  void SetSceneInfo (TGLSceneInfo* si) { fSceneInfo = si; }
117  void SetPhysShape (TGLPhysicalShape* pshp) { fPhysShape = pshp; }
118  void SetLogShape (TGLLogicalShape* lshp) { fLogShape = lshp; }
119  void SetObject (TObject* obj) { fObject = obj; }
120  void SetSpecific (void* spec) { fSpecific = spec; }
121  void SetMultiple (Bool_t multi) { fMultiple = multi; }
122  void SetHighlight (Bool_t hlt) { fHighlight = hlt; }
123 
124  void SetSecSelResult(ESecSelResult r) { fSecSelRes = r; }
125 
126  void Print();
127 
129  const TGLSelectRecord& r2);
130 
131  ClassDef(TGLSelectRecord, 0) // Standard GL selection record.
132 };
133 
134 
135 /**************************************************************************/
136 // TGLOvlSelectRecord
137 /**************************************************************************/
138 
140 {
141 protected:
142  // Secondary data (overlay dependent).
144 
145 public:
147  TGLOvlSelectRecord(UInt_t* data);
149  virtual ~TGLOvlSelectRecord();
150 
152 
153  virtual void Set(UInt_t* data);
154  virtual void Reset();
155 
157  void SetOvlElement(TGLOverlayElement* e) { fOvlElement = e; }
158 
159  ClassDef(TGLOvlSelectRecord, 0) // Standard GL overlay-selection record.
160 };
161 
162 #endif
UInt_t GetCurrItem() const
void SetSecSelResult(ESecSelResult r)
void SetOvlElement(TGLOverlayElement *e)
Float_t GetMinZ() const
float Float_t
Definition: RtypesCore.h:53
void SetPhysShape(TGLPhysicalShape *pshp)
ESecSelResult GetSecSelResult() const
virtual void Reset()
Reinitialise all data to null values.
virtual ~TGLOvlSelectRecord()
Destructor.
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
void SetRawOnly(UInt_t *data)
Setup the record from raw buffer.
TGLOvlSelectRecord()
Default constructor.
An overlay element.
Definition: TGLOverlay.h:22
Concrete physical shape - a GL drawable.
TGLOverlayElement * GetOvlElement() const
TGLSelectRecord()
Default constructor.
void SetTransparent(Bool_t t)
#define ClassDef(name, id)
Definition: Rtypes.h:254
Bool_t GetTransparent() const
virtual void Set(UInt_t *data)
Setup the record from raw buffer.
virtual void Reset()
Reinitialise all data to null values.
virtual void Reset()
Reinitialise all data to null values.
Float_t GetMaxZ() const
void SetMultiple(Bool_t multi)
Bool_t GetMultiple() const
virtual void Set(UInt_t *data)
Setup the record from raw buffer.
virtual ~TGLSelectRecordBase()
Destructor.
TGLOverlayElement * fOvlElement
ROOT::R::TRInterface & r
Definition: Object.C:4
TGLSceneInfo * GetSceneInfo() const
Standard selection record including information about containing scene and details ob out selected ob...
unsigned int r1[N_CITIES]
Definition: simanTSP.cxx:321
unsigned int UInt_t
Definition: RtypesCore.h:42
Int_t GetNLeft() const
void SetObject(TObject *obj)
Abstract logical shape - a GL 'drawable' - base for all shapes - faceset sphere etc.
void Print()
Print contents of the select record to stdout.
UInt_t * GetItems() const
UInt_t GetItem(Int_t i) const
TGLSelectRecordBase & operator=(const TGLSelectRecordBase &rec)
Copy operator.
void * GetSpecific() const
TGLOvlSelectRecord & operator=(const TGLOvlSelectRecord &rec)
Copy operator.
ESecSelResult fSecSelRes
TGLLogicalShape * fLogShape
void SetLogShape(TGLLogicalShape *lshp)
void SetHighlight(Bool_t hlt)
Mother of all ROOT objects.
Definition: TObject.h:58
void CopyItems(UInt_t *items)
Copy data from names. fN must already be set.
Bool_t GetHighlight() const
TGLPhysicalShape * fPhysShape
Base class for extended scene context.
Definition: TGLSceneInfo.h:26
ClassImp(TSlaveInfo) Int_t TSlaveInfo const TSlaveInfo * si
Used to sort slaveinfos by ordinal.
Definition: TProof.cxx:167
virtual ~TGLSelectRecord()
Destructor.
static Bool_t AreSameSelectionWise(const TGLSelectRecord &r1, const TGLSelectRecord &r2)
Check if the records imply the same selection result, that is, their secondary members are all equal...
TGLPhysicalShape * GetPhysShape() const
Selection record for overlay objects.
TGLLogicalShape * GetLogShape() const
TObject * GetObject() const
TObject * obj
void SetSpecific(void *spec)
TGLSelectRecord & operator=(const TGLSelectRecord &rec)
Copy operator.
TGLSceneInfo * fSceneInfo
Int_t GetN() const
unsigned int r2[N_CITIES]
Definition: simanTSP.cxx:322
virtual void Set(UInt_t *data)
Setup the record from raw buffer.
TGLSelectRecordBase()
Default constructor.
void SetSceneInfo(TGLSceneInfo *si)