Logo ROOT   6.18/05
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
17class TObject;
18class TGLSceneInfo;
20class TGLLogicalShape;
22
23/**************************************************************************/
24// TGLSelectRecordBase
25/**************************************************************************/
26
28{
29protected:
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
41public:
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{
76public:
78
79protected:
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
93public:
97 virtual ~TGLSelectRecord();
98
100
101 virtual void Set(UInt_t* data);
102 virtual void Reset();
103
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
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
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{
141protected:
142 // Secondary data (overlay dependent).
144
145public:
149 virtual ~TGLOvlSelectRecord();
150
152
153 virtual void Set(UInt_t* data);
154 virtual void Reset();
155
158
159 ClassDef(TGLOvlSelectRecord, 0) // Standard GL overlay-selection record.
160};
161
162#endif
ROOT::R::TRInterface & r
Definition: Object.C:4
#define e(i)
Definition: RSha256.hxx:103
int Int_t
Definition: RtypesCore.h:41
unsigned int UInt_t
Definition: RtypesCore.h:42
bool Bool_t
Definition: RtypesCore.h:59
float Float_t
Definition: RtypesCore.h:53
#define ClassDef(name, id)
Definition: Rtypes.h:326
Abstract logical shape - a GL 'drawable' - base for all shapes - faceset sphere etc.
An overlay element.
Definition: TGLOverlay.h:23
Selection record for overlay objects.
TGLOverlayElement * fOvlElement
TGLOverlayElement * GetOvlElement() const
TGLOvlSelectRecord()
Default constructor.
virtual ~TGLOvlSelectRecord()
Destructor.
virtual void Set(UInt_t *data)
Setup the record from raw buffer.
TGLOvlSelectRecord & operator=(const TGLOvlSelectRecord &rec)
Copy operator.
virtual void Reset()
Reinitialise all data to null values.
void SetOvlElement(TGLOverlayElement *e)
Concrete physical shape - a GL drawable.
Base class for extended scene context.
Definition: TGLSceneInfo.h:27
Base class for select records.
Float_t GetMinZ() const
TGLSelectRecordBase & operator=(const TGLSelectRecordBase &rec)
Copy operator.
void SetRawOnly(UInt_t *data)
Setup the record from raw buffer.
UInt_t GetItem(Int_t i) const
Int_t GetNLeft() const
Int_t GetN() const
void CopyItems(UInt_t *items)
Copy data from names. fN must already be set.
virtual void Set(UInt_t *data)
Setup the record from raw buffer.
virtual ~TGLSelectRecordBase()
Destructor.
Float_t GetMaxZ() const
TGLSelectRecordBase()
Default constructor.
virtual void Reset()
Reinitialise all data to null values.
UInt_t * GetItems() const
UInt_t GetCurrItem() const
Standard selection record including information about containing scene and details ob out selected ob...
TGLSelectRecord()
Default constructor.
virtual void Set(UInt_t *data)
Setup the record from raw buffer.
void SetSpecific(void *spec)
void * GetSpecific() const
Bool_t GetHighlight() const
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.
Bool_t GetMultiple() const
TGLSelectRecord & operator=(const TGLSelectRecord &rec)
Copy operator.
ESecSelResult GetSecSelResult() const
void SetTransparent(Bool_t t)
ESecSelResult fSecSelRes
void SetHighlight(Bool_t hlt)
Bool_t GetTransparent() const
void SetMultiple(Bool_t multi)
TObject * GetObject() const
void SetPhysShape(TGLPhysicalShape *pshp)
TGLSceneInfo * fSceneInfo
void SetSecSelResult(ESecSelResult r)
TGLLogicalShape * fLogShape
void SetObject(TObject *obj)
TGLPhysicalShape * fPhysShape
void SetSceneInfo(TGLSceneInfo *si)
TGLLogicalShape * GetLogShape() const
TGLPhysicalShape * GetPhysShape() const
virtual void Reset()
Reinitialise all data to null values.
void Print()
Print contents of the select record to stdout.
void SetLogShape(TGLLogicalShape *lshp)
TGLSceneInfo * GetSceneInfo() const
Mother of all ROOT objects.
Definition: TObject.h:37