Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TPointSet3DGL.cxx
Go to the documentation of this file.
1// @(#)root/gl:$Id$
2// Author: Matevz Tadel 7/4/2006
3
4/*************************************************************************
5 * Copyright (C) 1995-2006, 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#include "TPointSet3DGL.h"
13#include "TPointSet3D.h"
14
15#include <TGLRnrCtx.h>
16#include <TGLSelectRecord.h>
17#include <TGLIncludes.h>
18
19/** \class TPointSet3DGL
20\ingroup opengl
21Direct OpenGL renderer for TPointSet3D.
22*/
23
24
25////////////////////////////////////////////////////////////////////////////////
26/// Set model.
27
32
33////////////////////////////////////////////////////////////////////////////////
34/// Set bounding-box.
35
40
41////////////////////////////////////////////////////////////////////////////////
42/// Override from TGLLogicalShape.
43/// To account for large point-sizes we modify the projection matrix
44/// during selection and thus we need a direct draw.
45
47{
48 if (rnrCtx.Selection())
49 return kFALSE;
51}
52
53////////////////////////////////////////////////////////////////////////////////
54/// Draw function for TPointSet3D. Skips line-pass of outline mode.
55
57{
58 if (rnrCtx.IsDrawPassOutlineLine())
59 return;
60
62}
63
64////////////////////////////////////////////////////////////////////////////////
65/// Direct GL rendering for TPointSet3D.
66
68{
69 //printf("TPointSet3DGL::DirectDraw Style %d, LOD %d\n", rnrCtx.Style(), rnrCtx.LOD());
70 //printf(" sel=%d, secsel=%d\n", rnrCtx.Selection(), rnrCtx.SecSelection());
71
73
74 TGLUtil::LockColor(); // Keep color from TGLPhysicalShape.
75 TGLUtil::RenderPolyMarkers(q, 0, q.GetP(), q.Size(),
76 rnrCtx.GetPickRadius(),
77 rnrCtx.Selection(),
78 rnrCtx.SecSelection());
80}
81
82////////////////////////////////////////////////////////////////////////////////
83/// Processes secondary selection from TGLViewer.
84/// Calls TPointSet3D::PointSelected(Int_t) with index of selected
85/// point as an argument.
86
88{
89 if (rec.GetN() < 2) return;
91 q.PointSelected(rec.GetItem(1));
92}
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
float * q
virtual void Draw(TGLRnrCtx &rnrCtx) const
Draw the GL drawable, using draw flags.
TObject * fExternalObj
! Also plays the role of ID.
void SetAxisAlignedBBox(Float_t xmin, Float_t xmax, Float_t ymin, Float_t ymax, Float_t zmin, Float_t zmax)
Set axis-aligned bounding-box.
Definition TGLObject.cxx:85
Bool_t ShouldDLCache(const TGLRnrCtx &rnrCtx) const override
Decide if display-list should be used for this pass rendering, as determined by rnrCtx.
Definition TGLObject.cxx:40
Bool_t SetModelCheckClass(TObject *obj, TClass *cls)
Checks if obj is of proper class and sets the model.
Definition TGLObject.cxx:70
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
Definition TGLRnrCtx.h:41
Standard selection record including information about containing scene and details ob out selected ob...
static UInt_t LockColor()
Prevent further color changes.
Definition TGLUtil.cxx:1660
static UInt_t UnlockColor()
Allow color changes.
Definition TGLUtil.cxx:1668
static void RenderPolyMarkers(const TAttMarker &marker, Char_t transp, Float_t *p, Int_t n, Int_t pick_radius=0, Bool_t selection=kFALSE, Bool_t sec_selection=kFALSE)
Render polymarkers at points specified by p-array.
Definition TGLUtil.cxx:1971
Mother of all ROOT objects.
Definition TObject.h:42
Bool_t SetModel(TObject *obj, const Option_t *opt=nullptr) override
Set model.
void Draw(TGLRnrCtx &rnrCtx) const override
Draw function for TPointSet3D. Skips line-pass of outline mode.
void SetBBox() override
Set bounding-box.
void ProcessSelection(TGLRnrCtx &rnrCtx, TGLSelectRecord &rec) override
Processes secondary selection from TGLViewer.
Bool_t ShouldDLCache(const TGLRnrCtx &rnrCtx) const override
Override from TGLLogicalShape.
void DirectDraw(TGLRnrCtx &rnrCtx) const override
Direct GL rendering for TPointSet3D.
TPolyMarker3D using TPointSet3DGL for direct OpenGL rendering.
Definition TPointSet3D.h:22
static TClass * Class()