Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 ~TGLSelectRecord() override;
98
100
101 void Set(UInt_t* data) override;
102 void Reset() override;
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 ClassDefOverride(TGLSelectRecord, 0) // Standard GL selection record.
132};
133
134
135/**************************************************************************/
136// TGLOvlSelectRecord
137/**************************************************************************/
138
140{
141protected:
142 // Secondary data (overlay dependent).
144
145public:
149 ~TGLOvlSelectRecord() override;
150
152
153 void Set(UInt_t* data) override;
154 void Reset() override;
155
158
159 ClassDefOverride(TGLOvlSelectRecord, 0) // Standard GL overlay-selection record.
160};
161
162#endif
#define e(i)
Definition RSha256.hxx:103
bool Bool_t
Definition RtypesCore.h:63
float Float_t
Definition RtypesCore.h:57
#define ClassDef(name, id)
Definition Rtypes.h:337
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
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.
void Reset() override
Reinitialise all data to null values.
TGLOverlayElement * fOvlElement
~TGLOvlSelectRecord() override
Destructor.
TGLOverlayElement * GetOvlElement() const
TGLOvlSelectRecord()
Default constructor.
TGLOvlSelectRecord & operator=(const TGLOvlSelectRecord &rec)
Copy operator.
void Set(UInt_t *data) override
Setup the record from raw buffer.
void SetOvlElement(TGLOverlayElement *e)
Concrete physical shape - a GL drawable.
Base class for extended scene context.
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
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() override
Destructor.
TGLSelectRecord()
Default constructor.
void SetSpecific(void *spec)
void * GetSpecific() const
Bool_t GetHighlight() const
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)
void Reset() override
Reinitialise all data to null values.
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
void Print()
Print contents of the select record to stdout.
void SetLogShape(TGLLogicalShape *lshp)
void Set(UInt_t *data) override
Setup the record from raw buffer.
TGLSceneInfo * GetSceneInfo() const
Mother of all ROOT objects.
Definition TObject.h:41