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#ifdef WIN32
13#include "Windows4root.h"
14#endif
15
16#include "TPointSet3DGL.h"
17#include "TPointSet3D.h"
18
19#include <TGLRnrCtx.h>
20#include <TGLSelectRecord.h>
21#include <TGLIncludes.h>
22
23/** \class TPointSet3DGL
24\ingroup opengl
25Direct OpenGL renderer for TPointSet3D.
26*/
27
28
29////////////////////////////////////////////////////////////////////////////////
30/// Set model.
31
36
37////////////////////////////////////////////////////////////////////////////////
38/// Set bounding-box.
39
44
45////////////////////////////////////////////////////////////////////////////////
46/// Override from TGLLogicalShape.
47/// To account for large point-sizes we modify the projection matrix
48/// during selection and thus we need a direct draw.
49
51{
52 if (rnrCtx.Selection())
53 return kFALSE;
55}
56
57////////////////////////////////////////////////////////////////////////////////
58/// Draw function for TPointSet3D. Skips line-pass of outline mode.
59
61{
62 if (rnrCtx.IsDrawPassOutlineLine())
63 return;
64
66}
67
68////////////////////////////////////////////////////////////////////////////////
69/// Direct GL rendering for TPointSet3D.
70
72{
73 //printf("TPointSet3DGL::DirectDraw Style %d, LOD %d\n", rnrCtx.Style(), rnrCtx.LOD());
74 //printf(" sel=%d, secsel=%d\n", rnrCtx.Selection(), rnrCtx.SecSelection());
75
77
78 TGLUtil::LockColor(); // Keep color from TGLPhysicalShape.
79 TGLUtil::RenderPolyMarkers(q, 0, q.GetP(), q.Size(),
80 rnrCtx.GetPickRadius(),
81 rnrCtx.Selection(),
82 rnrCtx.SecSelection());
84}
85
86////////////////////////////////////////////////////////////////////////////////
87/// Processes secondary selection from TGLViewer.
88/// Calls TPointSet3D::PointSelected(Int_t) with index of selected
89/// point as an argument.
90
92{
93 if (rec.GetN() < 2) return;
95 q.PointSelected(rec.GetItem(1));
96}
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
first replica
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:41
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()