Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
TGLPShapeObjEditor.cxx
Go to the documentation of this file.
1// @(#)root/gl:$Id$
2// Author: Matevz Tadel 25/09/2006
3
4#include <cstring>
5
7#include "TGLPShapeObj.h"
8#include "TGedEditor.h"
9
10#include "TG3DLine.h"
11#include "TGButton.h"
12#include "TGButtonGroup.h"
13#include "TString.h"
14#include "TGLabel.h"
15#include "TGSlider.h"
16#include "TGNumberEntry.h"
17#include "TROOT.h"
18#include "TVirtualMutex.h"
19
20#include "TVirtualX.h"
21#include "TGLViewer.h"
22#include "TGLUtil.h"
23#include "TGLPhysicalShape.h"
24#include "TGLWidget.h"
25#include "TGLIncludes.h"
26
27#include "Buttons.h"
28
29/** \class TGLPShapeObjEditor
30\ingroup opengl
31GUI editor for TGLPShapeObj.
32*/
33
34
44
53
64
65////////////////////////////////////////////////////////////////////////////////
66/// Constructor of TGLPhysicalShape editor GUI.
67
69 : TGedFrame(p, width, height, options | kVerticalFrame, back),
70 fLb(kLHintsTop | kLHintsCenterX | kLHintsExpandX, 2, 2, 3, 3), //button
71 fLe(kLHintsTop | kLHintsCenterX | kLHintsExpandX, 0, 0, 3, 3), //entries
72 fLl(kLHintsLeft, 0, 8, 6, 0), // labels
73 fLs(kLHintsTop | kLHintsCenterX, 2, 2, 0, 0), ///sliders
74 fGeoFrame(nullptr),fGeoApplyButton(nullptr),
75 fColorFrame(nullptr),
76 fRedSlider(nullptr), fGreenSlider(nullptr), fBlueSlider(nullptr), fAlphaSlider(nullptr), fShineSlider(nullptr),
77 fColorApplyButton(nullptr), fColorApplyFamily(nullptr),
78 fRGBA(),
79 fPShapeObj(nullptr)
80{
81 fRGBA[12] = fRGBA[13] = fRGBA[14] = 0.0f;
82 fRGBA[15] = 1.0f;
83 fRGBA[16] = 60.0f;
84
87}
88
89////////////////////////////////////////////////////////////////////////////////
90/// Destroy color editor GUI component.
91/// Done automatically.
92
96
97////////////////////////////////////////////////////////////////////////////////
98/// Shape has changed.
99/// Check if set to zero and make sure we're no longer in editor.
100
102{
104 if (shape == nullptr && fGedEditor->GetModel() == fPShapeObj)
105 fGedEditor->SetModel(fGedEditor->GetPad(), fPShapeObj->fViewer, kButton1Down);
106}
107
108////////////////////////////////////////////////////////////////////////////////
109/// Shape has been modified.
110/// Update editor if we're still shown. Otherwise unref.
111
113{
114 if (fGedEditor->GetModel() == fPShapeObj)
115 fGedEditor->SetModel(fGedEditor->GetPad(), fPShapeObj, kButton1Down);
116 else
117 SetPShape(nullptr);
118}
119
120////////////////////////////////////////////////////////////////////////////////
121/// Sets model or disables/hides viewer.
122
124{
125 fPShapeObj = nullptr;
126
127 fPShapeObj = static_cast<TGLPShapeObj *>(obj);
128 SetPShape(fPShapeObj->fPShape);
129
130 SetRGBA(fPShapeObj->fPShape->Color());
131 SetCenter(fPShapeObj->fPShape->GetTranslation().CArr());
132 SetScale(fPShapeObj->fPShape->GetScale().CArr());
134}
135
136////////////////////////////////////////////////////////////////////////////////
137/// Set internal center data from 3 component 'c'.
138
140{
141 fGeomData[kCenterX]->SetNumber(c[0]);
142 fGeomData[kCenterY]->SetNumber(c[1]);
143 fGeomData[kCenterZ]->SetNumber(c[2]);
144}
145
146////////////////////////////////////////////////////////////////////////////////
147/// Set internal scale data from 3 component 'c'.
148
150{
151 fGeomData[kScaleX]->SetNumber(s[0]);
152 fGeomData[kScaleY]->SetNumber(s[1]);
153 fGeomData[kScaleZ]->SetNumber(s[2]);
154}
155
156////////////////////////////////////////////////////////////////////////////////
157/// Process 'Apply' - update the viewer object from GUI.
158
160{
161 TGLVertex3 trans;
162 TGLVector3 scale;
163 GetObjectData(trans.Arr(), scale.Arr());
164 if (fPShape) {
165 fPShape->SetTranslation(trans);
166 fPShape->Scale(scale);
167 }
168 fPShapeObj->fViewer->RequestDraw();
170}
171
172////////////////////////////////////////////////////////////////////////////////
173/// Extract the GUI object data, return center in 3 component 'center'
174/// scale in 3 component 'scale'.
175
177{
178 center[0] = fGeomData[kCenterX]->GetNumber();
179 center[1] = fGeomData[kCenterY]->GetNumber();
180 center[2] = fGeomData[kCenterZ]->GetNumber();
181 scale[0] = fGeomData[kScaleX]->GetNumber();
182 scale[1] = fGeomData[kScaleY]->GetNumber();
183 scale[2] = fGeomData[kScaleZ]->GetNumber();
184}
185
186////////////////////////////////////////////////////////////////////////////////
187/// Process setting of value in edit box - activate 'Apply' button.
188
190{
191 if (fGeoApplyButton->GetState() != kButtonUp)
192 fGeoApplyButton->SetState(kButtonUp);
193}
194
195////////////////////////////////////////////////////////////////////////////////
196/// Create GUI for setting scale and position.
197
199{
201
202 TGLabel *label=nullptr;
203
204 // Postion container
205 TGGroupFrame* container = new TGGroupFrame(fGeoFrame, "Object position:");
207 fGeoFrame->AddFrame(container, new TGLayoutHints(kLHintsTop | kLHintsCenterX | kLHintsExpandX, 8, 8, 3, 3));//-
209
211
212 hf = new TGHorizontalFrame(container);
213 label = new TGLabel(hf, "X:");
214 hf->AddFrame(label, new TGLayoutHints(fLl));
215 fGeomData[kCenterX] = new TGNumberEntry(hf, 0.0, 8, kNExc);
217 fGeomData[kCenterX]->Connect("ValueSet(Long_t)", "TGLPShapeObjEditor",
218 this, "GeoValueSet(Long_t)");
219 container->AddFrame(hf, new TGLayoutHints(lh));
220
221 hf = new TGHorizontalFrame(container);
222 label = new TGLabel(hf, "Y:");
223 hf->AddFrame(label, new TGLayoutHints(fLl));
224 fGeomData[kCenterY] = new TGNumberEntry(hf, 0.0, 8, kNEyc);
226 fGeomData[kCenterY]->Connect("ValueSet(Long_t)", "TGLPShapeObjEditor",
227 this, "GeoValueSet(Long_t)");
228 container->AddFrame(hf, new TGLayoutHints(lh));
229
230 hf = new TGHorizontalFrame(container);
231 hf->AddFrame(new TGLabel(hf, "Z:"), new TGLayoutHints(fLl));
232 fGeomData[kCenterZ] = new TGNumberEntry(hf, 1.0, 8, kNEzc);
234 fGeomData[kCenterZ]->Connect("ValueSet(Long_t)", "TGLPShapeObjEditor",
235 this, "GeoValueSet(Long_t)");
236 container->AddFrame(hf, new TGLayoutHints(lh));
237
238 // Scale container
239 TGGroupFrame* osf = new TGGroupFrame(fGeoFrame, "Object scale:", kLHintsTop | kLHintsCenterX);
241 fGeoFrame->AddFrame(osf, new TGLayoutHints(kLHintsTop | kLHintsCenterX | kLHintsExpandX, 8, 8, 3, 3));
242
243 hf = new TGHorizontalFrame(osf);
244 hf->AddFrame(new TGLabel(hf, "X:"),new TGLayoutHints(fLl));
245 fGeomData[kScaleX] = new TGNumberEntry(hf, 1.0, 5, kNExs);
247 fGeomData[kScaleX]->Connect("ValueSet(Long_t)", "TGLPShapeObjEditor",
248 this, "GeoValueSet(Long_t)");
249 osf->AddFrame(hf, new TGLayoutHints(lh));
250
251 hf = new TGHorizontalFrame(osf);
252 hf->AddFrame(new TGLabel(hf, "Y:"),new TGLayoutHints(fLl));
253 fGeomData[kScaleY] = new TGNumberEntry(hf, 1.0, 5, kNEys);
255 fGeomData[kScaleY]->Connect("ValueSet(Long_t)", "TGLPShapeObjEditor",
256 this, "GeoValueSet(Long_t)");
257 osf->AddFrame(hf, new TGLayoutHints(lh));
258
259 hf = new TGHorizontalFrame(osf);
260 hf->AddFrame(new TGLabel(hf, "Z:"),new TGLayoutHints(fLl));
261 fGeomData[kScaleZ] = new TGNumberEntry(hf, 1.0, 5, kNEzs);
263 fGeomData[kScaleZ]->Connect("ValueSet(Long_t)", "TGLPShapeObjEditor",
264 this, "GeoValueSet(Long_t)");
265 osf->AddFrame(hf, new TGLayoutHints(lh));
266
267 hf = new TGHorizontalFrame(osf);
271 osf->AddFrame(hf, new TGLayoutHints(lh));
272
273 // Modify button
274 fGeoApplyButton = new TGTextButton(fGeoFrame, "Modify object");
277 fGeoApplyButton->Connect("Pressed()", "TGLPShapeObjEditor", this, "DoGeoButton()");
278}
279
280////////////////////////////////////////////////////////////////////////////////
281/// Set color sliders from 17 component 'rgba'.
282
284{
287
288 for (Int_t i = 0; i < 17; ++i) fRGBA[i] = rgba[i];
289
290 fRedSlider->SetPosition(Int_t(fRGBA[fLMode * 4] * 100));
291 fGreenSlider->SetPosition(Int_t(fRGBA[fLMode * 4 + 1] * 100));
292 fBlueSlider->SetPosition(Int_t(fRGBA[fLMode * 4 + 2] * 100));
293 fShineSlider->SetPosition(Int_t(fRGBA[16]));
294
295 DrawSphere();
296}
297
298////////////////////////////////////////////////////////////////////////////////
299/// Process slider movement.
300
302{
303 TGSlider *frm = (TGSlider *)gTQSender;
304
305 if (frm) {
306 Int_t wid = frm->WidgetId();
307
308 switch (wid) {
309 case kHSr:
310 fRGBA[fLMode * 4] = val / 100.f;
311 break;
312 case kHSg:
313 fRGBA[fLMode * 4 + 1] = val / 100.f;
314 break;
315 case kHSb:
316 fRGBA[fLMode * 4 + 2] = val / 100.f;
317 break;
318 case kHSa:
319 fRGBA[fLMode * 4 + 3] = val / 100.f;
320 break;
321 case kHSs:
322 fRGBA[16] = val;
323 break;
324 }
325
326 fColorApplyButton->SetState(kButtonUp);
327 fColorApplyFamily->SetState(kButtonUp);
328 DrawSphere();
329 }
330}
331
332////////////////////////////////////////////////////////////////////////////////
333/// Process button action.
334
336{
337 TGButton *btn = (TGButton *) gTQSender;
338 Int_t id = btn->WidgetId();
339
340 switch (id) {
341 case kCPd:
342 fLightTypes[fLMode]->SetState(kButtonUp);
345 break;
346 case kCPa:
347 fLightTypes[fLMode]->SetState(kButtonUp);
350 break;
351 case kCPs:
352 fLightTypes[fLMode]->SetState(kButtonUp);
355 break;
356 case kCPe:
357 fLightTypes[fLMode]->SetState(kButtonUp);
360 break;
361 case kTBa:
364 if (fPShape) {
365 fPShape->SetColor(GetRGBA());
366 }
367 fPShapeObj->fViewer->RequestDraw();
368 break;
369 case kTBaf:
372 if (fPShape) {
373 fPShape->SetColorOnFamily(GetRGBA());
374 }
375 fPShapeObj->fViewer->RequestDraw();
376 break;
377 }
378}
379
380////////////////////////////////////////////////////////////////////////////////
381/// Create Diffuse/Ambient/Specular/Emissive radio buttons and sub-frames.
382
384{
385 TGGroupFrame *partFrame = new TGGroupFrame(fColorFrame, "Color components:", kLHintsTop | kLHintsCenterX);
386 fColorFrame->AddFrame(partFrame, new TGLayoutHints(kLHintsTop | kLHintsCenterX, 2, 0, 2, 2));
387
389 TGMatrixLayout *ml = new TGMatrixLayout(partFrame, 0, 1, 10);
390 partFrame->SetLayoutManager(ml);
391
392 // partFrame will delete the layout manager ml for us so don't add to fTrash
393 fLightTypes[kDiffuse] = new TGRadioButton(partFrame, "Diffuse", kCPd);
394 fLightTypes[kDiffuse]->Connect("Pressed()", "TGLPShapeObjEditor", this, "DoColorButton()");
395 fLightTypes[kDiffuse]->SetToolTipText("Diffuse component of color");
396 partFrame->AddFrame(fLightTypes[kDiffuse]);
397
398 fLightTypes[kAmbient] = new TGRadioButton(partFrame, "Ambient", kCPa);
399 fLightTypes[kAmbient]->Connect("Pressed()", "TGLPShapeObjEditor", this, "DoColorButton()");
400 fLightTypes[kAmbient]->SetToolTipText("Ambient component of color");
401 partFrame->AddFrame(fLightTypes[kAmbient]);
402
403 fLightTypes[kSpecular] = new TGRadioButton(partFrame, "Specular", kCPs);
404 fLightTypes[kSpecular]->Connect("Pressed()", "TGLPShapeObjEditor", this, "DoColorButton()");
405 fLightTypes[kSpecular]->SetToolTipText("Specular component of color");
406 partFrame->AddFrame(fLightTypes[kSpecular]);
407
408 fLightTypes[kEmission] = new TGRadioButton(partFrame, "Emissive", kCPe);
409 fLightTypes[kEmission]->Connect("Pressed()", "TGLPShapeObjEditor", this, "DoColorButton()");
410 fLightTypes[kEmission]->SetToolTipText("Emissive component of color");
411 partFrame->AddFrame(fLightTypes[kEmission]);
412
414 fLightTypes[fLMode]->SetState(kButtonDown);
415}
416
417////////////////////////////////////////////////////////////////////////////////
418/// Create GUI for setting light color.
419
421{
422 UInt_t sw = 120; //fColorFrame->GetDefalutWidth();,
423
424 // Create Red/Green/BlueAlpha/Shine sliders
425 fColorFrame->AddFrame(new TGLabel(fColorFrame, "Red :"), new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 0, 0, 0));
427 fRedSlider->Connect("PositionChanged(Int_t)", "TGLPShapeObjEditor", this, "DoColorSlider(Int_t)");
428 fRedSlider->SetRange(0, 100);
429 fRedSlider->SetPosition(Int_t(fRGBA[0] * 100));
430 fColorFrame->AddFrame(fRedSlider, new TGLayoutHints(fLs));
431
432
433 fColorFrame->AddFrame(new TGLabel(fColorFrame, "Green :"), new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 0, 0, 0));
435 fGreenSlider->Connect("PositionChanged(Int_t)", "TGLPShapeObjEditor", this, "DoColorSlider(Int_t)");
436 fGreenSlider->SetRange(0, 100);
437 fGreenSlider->SetPosition(Int_t(fRGBA[1] * 100));
438 fColorFrame->AddFrame(fGreenSlider, new TGLayoutHints(fLs));
439
440
441 fColorFrame->AddFrame(new TGLabel(fColorFrame, "Blue :"), new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 0, 0, 0));
443 fBlueSlider->Connect("PositionChanged(Int_t)", "TGLPShapeObjEditor", this, "DoColorSlider(Int_t)");
444 fBlueSlider->SetRange(0, 100);
445 fBlueSlider->SetPosition(Int_t(fRGBA[2] * 100));
446 fColorFrame->AddFrame(fBlueSlider, new TGLayoutHints(fLs));
447
448 fColorFrame->AddFrame(new TGLabel(fColorFrame, "Shine :"), new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 0, 0, 0));
450 fShineSlider->Connect("PositionChanged(Int_t)", "TGLPShapeObjEditor", this, "DoColorSlider(Int_t)");
451 fShineSlider->SetRange(0, 128);
452 fColorFrame->AddFrame(fShineSlider, new TGLayoutHints(fLs));
453}
454
455////////////////////////////////////////////////////////////////////////////////
456/// Update GUI sliders from internal data.
457
459{
460 fRedSlider->SetPosition(Int_t(fRGBA[fLMode * 4] * 100));
461 fGreenSlider->SetPosition(Int_t(fRGBA[fLMode * 4 + 1] * 100));
462 fBlueSlider->SetPosition(Int_t(fRGBA[fLMode * 4 + 2] * 100));
463 // fAlphaSlider->SetPosition(Int_t(fRGBA[fLMode * 4 + 3] * 100));
464
465 if (fRGBA[16] >= 0.f)
466 fShineSlider->SetPosition(Int_t(fRGBA[16]));
467}
468
469////////////////////////////////////////////////////////////////////////////////
470/// Redraw widget. Render sphere and pass to base-class.
471
477
478////////////////////////////////////////////////////////////////////////////////
479
480namespace {
481 GLUquadric *GetQuadric()
482 {
483 // GLU quadric.
484
485 static struct Init {
486 Init()
487 {
488 fQuad = gluNewQuadric();
489 if (!fQuad) {
490 Error("GetQuadric::Init", "could not create quadric object");
491 } else {
492 gluQuadricOrientation(fQuad, (GLenum)GLU_OUTSIDE);
493 gluQuadricDrawStyle(fQuad, (GLenum)GLU_FILL);
494 gluQuadricNormals(fQuad, (GLenum)GLU_FLAT);
495 }
496 }
497 ~Init()
498 {
499 if(fQuad)
500 gluDeleteQuadric(fQuad);
501 }
502 GLUquadric *fQuad;
503 }singleton;
504
505 return singleton.fQuad;
506 }
507
508}
509
510////////////////////////////////////////////////////////////////////////////////
511/// Draw local sphere reflecting current color options.
512
514{
515 if (!gVirtualX->IsCmdThread()) {
516 gROOT->ProcessLineFast(Form("((TGLPShapeObjEditor *)0x%zx)->DrawSphere()", (size_t)this));
517 return;
518 }
519
521
522 fMatView->MakeCurrent();
523 glViewport(0, 0, fMatView->GetWidth(), fMatView->GetHeight());
524 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
525
526 glEnable(GL_LIGHTING);
527 glEnable(GL_LIGHT0);
528 glEnable(GL_DEPTH_TEST);
529 glEnable(GL_CULL_FACE);
530 glCullFace(GL_BACK);
531 glMatrixMode(GL_PROJECTION);
532 glLoadIdentity();
533 glFrustum(-0.5, 0.5, -0.5, 0.5, 1., 10.);
534 glMatrixMode(GL_MODELVIEW);
535 glLoadIdentity();
536 Float_t ligPos[] = {0.f, 0.f, 0.f, 1.f};
537 glLightfv(GL_LIGHT0, GL_POSITION, ligPos);
538 glTranslated(0., 0., -3.);
539
540 const Float_t whiteColor[] = {1.f, 1.f, 1.f, 1.f};
541 const Float_t nullColor[] = {0.f, 0.f, 0.f, 1.f};
542
543 if (fRGBA[16] < 0.f) {
544 glLightfv(GL_LIGHT0, GL_DIFFUSE, fRGBA);
545 glLightfv(GL_LIGHT0, GL_AMBIENT, fRGBA + 4);
546 glLightfv(GL_LIGHT0, GL_SPECULAR, fRGBA + 8);
547 glMaterialfv(GL_FRONT, GL_DIFFUSE, whiteColor);
548 glMaterialfv(GL_FRONT, GL_AMBIENT, nullColor);
549 glMaterialfv(GL_FRONT, GL_SPECULAR, whiteColor);
550 glMaterialfv(GL_FRONT, GL_EMISSION, nullColor);
551 glMaterialf(GL_FRONT, GL_SHININESS, 60.f);
552 } else {
553 glLightfv(GL_LIGHT0, GL_DIFFUSE, whiteColor);
554 glLightfv(GL_LIGHT0, GL_AMBIENT, nullColor);
555 glLightfv(GL_LIGHT0, GL_SPECULAR, whiteColor);
556 glMaterialfv(GL_FRONT, GL_DIFFUSE, fRGBA);
557 glMaterialfv(GL_FRONT, GL_AMBIENT, fRGBA + 4);
558 glMaterialfv(GL_FRONT, GL_SPECULAR, fRGBA + 8);
559 glMaterialfv(GL_FRONT, GL_EMISSION, fRGBA + 12);
560 glMaterialf(GL_FRONT, GL_SHININESS, fRGBA[16]);
561 }
562
563 glEnable(GL_BLEND);
564 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
565 GLUquadric * quad = GetQuadric();
566 if (quad) {
567 glRotated(-90., 1., 0., 0.);
568 gluSphere(quad, 1., 100, 100);
569 }
570 glDisable(GL_BLEND);
571
572 fMatView->SwapBuffers();
573}
574
575////////////////////////////////////////////////////////////////////////////////
576/// Create widgets to chose colors component and its RGBA values on fGedEditor
577/// model or family it belongs to.
578
580{
581 fColorFrame = this;
582
583 fMatView = TGLWidget::Create(fColorFrame, kFALSE, kTRUE, nullptr, 120, 120);
584 fColorFrame->AddFrame(fMatView, new TGLayoutHints(kLHintsTop | kLHintsCenterX, 2, 0, 2, 2));
585
587
589
590 //apply button creation
594 fColorApplyButton->Connect("Pressed()", "TGLPShapeObjEditor", this, "DoColorButton()");
595 //apply to family button creation
596 fColorApplyFamily = new TGTextButton(fColorFrame, "Apply to family", kTBaf);
599 fColorApplyFamily->Connect("Pressed()", "TGLPShapeObjEditor", this, "DoColorButton()");
600}
@ kButton1Down
Definition Buttons.h:17
@ kVerticalFrame
Definition GuiTypes.h:382
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:41
#define c(i)
Definition RSha256.hxx:101
int Int_t
Signed integer 4 bytes (int).
Definition RtypesCore.h:59
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
Definition RtypesCore.h:60
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
Definition RtypesCore.h:68
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
double Double_t
Double 8 bytes.
Definition RtypesCore.h:73
float Float_t
Float 4 bytes (float).
Definition RtypesCore.h:71
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
@ kButtonDown
Definition TGButton.h:54
@ kButtonDisabled
Definition TGButton.h:56
@ kButtonUp
Definition TGButton.h:53
@ kTBEndOfList
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsCenterX
Definition TGLayout.h:25
@ kLHintsTop
Definition TGLayout.h:27
@ kLHintsExpandX
Definition TGLayout.h:30
@ kScaleBoth
Definition TGSlider.h:36
@ kSlider1
Definition TGSlider.h:30
externvoid * gTQSender
Definition TQObject.h:46
#define gROOT
Definition TROOT.h:417
externTVirtualMutex * gROOTMutex
Definition TROOT.h:63
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2496
#define R__LOCKGUARD(mutex)
#define gVirtualX
Definition TVirtualX.h:375
A button abstract base class.
Definition TGButton.h:68
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
Definition TGFrame.cxx:992
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1109
void DoRedraw() override
Redraw the frame.
Definition TGFrame.cxx:422
A composite frame with a border and a title.
Definition TGFrame.h:532
virtual void SetTitlePos(ETitlePos pos=kLeft)
Definition TGFrame.h:574
Concrete class for horizontal slider.
Definition TGSlider.h:119
A composite frame that layout their children in horizontal way.
Definition TGFrame.h:387
void SetColorSlidersPos()
Update GUI sliders from internal data.
void PShapeModified() override
Shape has been modified.
void CreateColorSliders()
Create GUI for setting light color.
TGCompositeFrame * fColorFrame
TGButton * fLightTypes[4]
void CreateGeoControls()
Create GUI for setting scale and position.
TGNumberEntry * fGeomData[6]
void GeoValueSet(Long_t unusedVal)
Process setting of value in edit box - activate 'Apply' button.
void SetModel(TObject *obj) override
Sets model or disables/hides viewer.
void SetScale(const Double_t *scale)
Set internal scale data from 3 component 'c'.
void DoRedraw() override
Redraw widget. Render sphere and pass to base-class.
TGLPShapeObj * fPShapeObj
TGLPShapeObjEditor(const TGWindow *p=nullptr, Int_t width=140, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Constructor of TGLPhysicalShape editor GUI.
void DoColorButton()
Process button action.
~TGLPShapeObjEditor() override
Destroy color editor GUI component.
void DrawSphere() const
Draw local sphere reflecting current color options.
void CreateColorControls()
Create widgets to chose colors component and its RGBA values on fGedEditor model or family it belongs...
TGCompositeFrame * fGeoFrame
const Float_t * GetRGBA() const
void SetRGBA(const Float_t *rgba)
Set color sliders from 17 component 'rgba'.
void SetPShape(TGLPhysicalShape *shape) override
Shape has changed.
void CreateColorRadioButtons()
Create Diffuse/Ambient/Specular/Emissive radio buttons and sub-frames.
void SetCenter(const Double_t *center)
Set internal center data from 3 component 'c'.
void DoGeoButton()
Process 'Apply' - update the viewer object from GUI.
void GetObjectData(Double_t *shift, Double_t *scale)
Extract the GUI object data, return center in 3 component 'center' scale in 3 component 'scale'.
void DoColorSlider(Int_t val)
Process slider movement.
Wrap TGLPysicalShape into TObject so that it can be edited using GED.
virtual void SetPShape(TGLPhysicalShape *shape)
Set the shape.
TGLPhysicalShape * fPShape
friend class TGLPhysicalShape
3 component (x/y/z) vector class.
Definition TGLUtil.h:248
3 component (x/y/z) vertex class.
Definition TGLUtil.h:84
Double_t * Arr()
Definition TGLUtil.h:127
static TGLWidget * Create(const TGWindow *parent, Bool_t selectInput, Bool_t shareDefault, const TGLPaintDevice *shareDevice, UInt_t width, UInt_t height)
Static constructor for creating widget with default pixel format.
Definition TGLWidget.cxx:82
This class handles GUI labels.
Definition TGLabel.h:24
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
This layout managers does not make use of TGLayoutHints.
Definition TGLayout.h:269
TGNumberEntry is a number entry input widget with up/down buttons.
@ kNELLimitMin
Lower limit only.
Selects different options.
Definition TGButton.h:321
Slider widgets allow easy selection of a range.
Definition TGSlider.h:40
Yield an action as soon as it is clicked.
Definition TGButton.h:142
Int_t WidgetId() const
Definition TGWidget.h:68
ROOT GUI Window base class.
Definition TGWindow.h:23
TGedEditor * fGedEditor
manager of this frame
Definition TGedFrame.h:48
virtual TGVerticalFrame * CreateEditorTabSubFrame(const char *name)
Create a vertical frame to be used by 'owner' in extra tab 'name'.
TGedFrame(const TGedFrame &)=delete
Mother of all ROOT objects.
Definition TObject.h:42