12 #ifndef ROOT_TGLRnrCtx
13 #define ROOT_TGLRnrCtx
27 class TGLContextIdentity;
30 class TGLSelectBuffer;
50 static const char* StyleName(Short_t style);
70 enum EShapeSelectionLevel
76 kSSLImpliedHighlighted,
80 enum ESelectabilityOfTransparents
88 TGLRnrCtx(
const TGLRnrCtx&);
89 TGLRnrCtx& operator=(
const TGLRnrCtx&);
91 typedef std::list<TGLColorSet*> lpTGLColorSet_t;
94 TGLViewerBase *fViewer;
96 TGLSceneInfo *fSceneInfo;
102 Float_t fShapePixSize;
104 Short_t fViewerStyle;
107 Float_t fViewerWFLineW;
108 Float_t fSceneWFLineW;
109 Float_t fViewerOLLineW;
110 Float_t fSceneOLLineW;
112 TGLClip *fViewerClip;
118 TGLStopwatch fStopwatch;
119 Double_t fRenderTimeOut;
125 Bool_t fHighlightOutline;
127 Bool_t fSecSelection;
128 Short_t fSelectTransparents;
130 TGLRect *fPickRectangle;
131 TGLSelectBuffer*fSelectBuffer;
133 lpTGLColorSet_t*fColorSetStack;
134 Float_t fRenderScale;
139 Bool_t fDLCaptureOpen;
140 TGLContextIdentity *fGLCtxIdentity;
142 GLUquadric *fQuadric;
147 UChar_t *fGrabbedImage;
150 TGLRnrCtx(TGLViewerBase* viewer);
151 virtual ~TGLRnrCtx();
154 TGLViewerBase * GetViewer() {
return fViewer; }
155 TGLViewerBase & RefViewer() {
return *fViewer; }
156 TGLCamera * GetCamera() {
return fCamera; }
157 TGLCamera & RefCamera() {
return *fCamera; }
158 TGLSceneInfo * GetSceneInfo() {
return fSceneInfo; }
159 TGLSceneInfo & RefSceneInfo() {
return *fSceneInfo; }
160 TGLSceneBase * GetScene();
161 TGLSceneBase & RefScene();
163 const TGLCamera & RefCamera()
const {
return *fCamera; }
164 const TGLCamera * GetCamera()
const {
return fCamera; }
167 void SetCamera (TGLCamera* c) { fCamera = c; }
168 void SetSceneInfo(TGLSceneInfo* si) { fSceneInfo = si; }
171 Short_t ViewerLOD()
const {
return fViewerLOD; }
172 void SetViewerLOD(Short_t LOD) { fViewerLOD = LOD; }
173 Short_t SceneLOD()
const {
return fSceneLOD; }
174 void SetSceneLOD(Short_t LOD) { fSceneLOD = LOD; }
175 Short_t CombiLOD()
const {
return fCombiLOD; }
176 void SetCombiLOD(Short_t LOD) { fCombiLOD = LOD; }
177 Short_t ShapeLOD()
const {
return fShapeLOD; }
178 void SetShapeLOD(Short_t LOD) { fShapeLOD = LOD; }
179 Float_t ShapePixSize()
const {
return fShapePixSize; }
180 void SetShapePixSize(Float_t ps) { fShapePixSize = ps; }
182 Short_t ViewerStyle()
const {
return fViewerStyle; }
183 void SetViewerStyle(Short_t sty) { fViewerStyle = sty; }
184 Short_t SceneStyle()
const {
return fSceneStyle; }
185 void SetSceneStyle(Short_t sty) { fSceneStyle = sty; }
187 Float_t ViewerWFLineW()
const {
return fViewerWFLineW; }
188 void SetViewerWFLineW(Float_t w) { fViewerWFLineW = w; }
189 Float_t SceneWFLineW()
const {
return fSceneWFLineW; }
190 void SetSceneWFLineW(Float_t w) { fSceneWFLineW = w; }
191 Float_t ViewerOLLineW()
const {
return fViewerOLLineW; }
192 void SetViewerOLLineW(Float_t w) { fViewerOLLineW = w; }
193 Float_t SceneOLLineW()
const {
return fSceneOLLineW; }
194 void SetSceneOLLineW(Float_t w) { fSceneOLLineW = w; }
196 TGLClip* ViewerClip()
const {
return fViewerClip; }
197 void SetViewerClip(TGLClip *p) { fViewerClip = p; }
198 TGLClip* SceneClip()
const {
return fSceneClip; }
199 void SetSceneClip(TGLClip *p) { fSceneClip = p; }
200 TGLClip* Clip()
const {
return fClip; }
201 void SetClip(TGLClip *p) { fClip = p; }
202 Bool_t HasClip()
const {
return fClip != 0; }
204 Short_t DrawPass()
const {
return fDrawPass; }
205 void SetDrawPass(Short_t dpass) { fDrawPass = dpass; }
206 Bool_t IsDrawPassFilled()
const;
207 Bool_t IsDrawPassOutlineLine()
const {
return fDrawPass == kPassOutlineLine; }
210 Double_t RenderTimeOut()
const {
return fRenderTimeOut; }
211 void SetRenderTimeOut(Double_t tout) { fRenderTimeOut = tout; }
212 void StartStopwatch();
213 void StopStopwatch();
214 Bool_t IsStopwatchRunning()
const {
return fIsRunning; }
215 Bool_t HasStopwatchTimedOut();
218 Bool_t Highlight()
const {
return fHighlight; }
219 void SetHighlight(Bool_t hil) { fHighlight = hil; }
220 Bool_t HighlightOutline()
const {
return fHighlightOutline; }
221 void SetHighlightOutline(Bool_t ho) { fHighlightOutline = ho; }
222 Bool_t Selection()
const {
return fSelection; }
223 void SetSelection(Bool_t sel) { fSelection = sel; }
224 Bool_t SecSelection()
const {
return fSecSelection; }
225 void SetSecSelection(Bool_t secSel) { fSecSelection = secSel; }
227 Short_t SelectTransparents()
const {
return fSelectTransparents; }
228 void SetSelectTransparents(Short_t st) { fSelectTransparents = st; }
229 TGLRect * GetPickRectangle();
230 Int_t GetPickRadius();
231 TGLSelectBuffer * GetSelectBuffer()
const {
return fSelectBuffer; }
233 void BeginSelection(Int_t x, Int_t y, Int_t r=3);
234 void EndSelection (Int_t glResult);
237 TGLColorSet& ColorSet();
239 TGLColorSet* ChangeBaseColorSet(TGLColorSet* set);
240 TGLColorSet* GetBaseColorSet();
242 void ColorOrForeground(Color_t col);
244 Float_t GetRenderScale()
const {
return fRenderScale; }
245 void SetRenderScale(Float_t s) { fRenderScale = s; }
247 UInt_t GetEventKeySym()
const {
return fEventKeySym; }
248 void SetEventKeySym(UInt_t k) { fEventKeySym = k; }
250 Bool_t IsDLCaptureOpen()
const {
return fDLCaptureOpen; }
251 void OpenDLCapture();
252 void CloseDLCapture();
254 TGLContextIdentity* GetGLCtxIdentity()
const {
return fGLCtxIdentity; }
255 void SetGLCtxIdentity(TGLContextIdentity* cid) { fGLCtxIdentity = cid; }
257 void RegisterFont(Int_t size, Int_t file, Int_t mode, TGLFont& out);
258 void RegisterFont(Int_t size,
const char* name, Int_t mode, TGLFont& out);
259 void RegisterFontNoScale(Int_t size, Int_t file, Int_t mode, TGLFont& out);
260 void RegisterFontNoScale(Int_t size,
const char* name, Int_t mode, TGLFont& out);
261 void ReleaseFont(TGLFont& font);
263 GLUquadric* GetGluQuadric();
266 void SetGrabImage(Bool_t gi) { fGrabImage = gi; }
267 Bool_t GetGrabImage()
const {
return fGrabImage; }
270 void ProjectionMatrixPushIdentity();
271 void ProjectionMatrixPop();
273 ClassDef(TGLRnrCtx, 0);