Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGLSelectBuffer.h
Go to the documentation of this file.
1// @(#)root/gl:$Id$
2// Author: Matevz Tadel, Feb 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_TGLSelectBuffer
13#define ROOT_TGLSelectBuffer
14
15#include <Rtypes.h>
16
18
19#include <vector>
20#include <utility>
21
22/**************************************************************************/
23// TGLSelectBuffer
24/**************************************************************************/
25
27{
28protected:
29 Int_t fBufSize; // Size of buffer.
30 UInt_t* fBuf; // Actual buffer.
31
32 Int_t fNRecords; // Number of records as returned by glRenderMode.
33
34 typedef std::pair<UInt_t, UInt_t*> RawRecord_t;
35 typedef std::vector<RawRecord_t> vRawRecord_t;
36
38
40
41public:
43 virtual ~TGLSelectBuffer();
44
45 Int_t GetBufSize() const { return fBufSize; }
46 UInt_t* GetBuf() const { return fBuf; }
47 Int_t GetNRecords() const { return fNRecords; }
48
50 void Grow();
51
52 void ProcessResult(Int_t glResult);
53
54 UInt_t* RawRecord(Int_t i) { return fSortedRecords[i].second; }
55
57
58 ClassDef(TGLSelectBuffer, 0) // OpenGL select buffer with depth sorting.
59};
60
61#endif
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
#define ClassDef(name, id)
Definition Rtypes.h:342
Encapsulates OpenGL select buffer.
UInt_t * RawRecord(Int_t i)
void ProcessResult(Int_t glResult)
Process result of GL-selection: sort the hits by their minimum z-coordinate.
virtual ~TGLSelectBuffer()
Destructor.
Int_t GetNRecords() const
void Grow()
Increase size of the select buffer.
vRawRecord_t fSortedRecords
std::vector< RawRecord_t > vRawRecord_t
static Int_t fgMaxBufSize
std::pair< UInt_t, UInt_t * > RawRecord_t
Bool_t CanGrow()
static: return true if current buffer is smaller than the max buffer size
TGLSelectBuffer()
Constructor.
Int_t GetBufSize() const
Int_t SelectRecord(TGLSelectRecordBase &rec, Int_t i)
Fill select record rec with data on (sorted) position i.
UInt_t * GetBuf() const
Base class for select records.