Logo ROOT   6.10/09
Reference Guide
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 
6 #include "TGLPShapeObjEditor.h"
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 "TClass.h"
16 #include "TGCanvas.h"
17 #include "TGTab.h"
18 #include "TGSlider.h"
19 #include "TGNumberEntry.h"
20 #include "TGButtonGroup.h"
21 #include "TROOT.h"
22 #include "TVirtualMutex.h"
23 
24 #include "TVirtualGL.h"
25 #include "TVirtualX.h"
26 #include "TGLViewer.h"
27 #include "TGLUtil.h"
28 #include "TGLPhysicalShape.h"
29 #include "TGLWidget.h"
30 #include "TGLIncludes.h"
31 
32 #include "Buttons.h"
33 
34 /** \class TGLPShapeObjEditor
35 \ingroup opengl
36 GUI editor for TGLPShapeObj.
37 */
38 
40 
41 enum EGeometry {
49 };
50 
58 };
59 
69 };
70 
71 ////////////////////////////////////////////////////////////////////////////////
72 /// Constructor of TGLPhysicalShape editor GUI.
73 
75  : TGedFrame(p, width, height, options | kVerticalFrame, back),
76  fLb(kLHintsTop | kLHintsCenterX | kLHintsExpandX, 2, 2, 3, 3), //button
77  fLe(kLHintsTop | kLHintsCenterX | kLHintsExpandX, 0, 0, 3, 3), //entries
78  fLl(kLHintsLeft, 0, 8, 6, 0), // labels
79  fLs(kLHintsTop | kLHintsCenterX, 2, 2, 0, 0), ///sliders
80  fGeoFrame(0),fGeoApplyButton(0),
81  fColorFrame(0),
82  fRedSlider(0), fGreenSlider(0), fBlueSlider(0), fAlphaSlider(0), fShineSlider(0),
83  fColorApplyButton(0), fColorApplyFamily(0),
84  fRGBA(),
85  fPShapeObj(0)
86 {
87  fRGBA[12] = fRGBA[13] = fRGBA[14] = 0.0f;
88  fRGBA[15] = 1.0f;
89  fRGBA[16] = 60.0f;
90 
93 }
94 
95 ////////////////////////////////////////////////////////////////////////////////
96 /// Destroy color editor GUI component.
97 /// Done automatically.
98 
100 {
101 }
102 
103 ////////////////////////////////////////////////////////////////////////////////
104 /// Shape has changed.
105 /// Check if set to zero and make sure we're no longer in editor.
106 
108 {
110  if (shape == 0 && fGedEditor->GetModel() == fPShapeObj)
112 }
113 
114 ////////////////////////////////////////////////////////////////////////////////
115 /// Shape has been modified.
116 /// Update editor if we're still shown. Otherwise unref.
117 
119 {
120  if (fGedEditor->GetModel() == fPShapeObj)
122  else
123  SetPShape(0);
124 }
125 
126 ////////////////////////////////////////////////////////////////////////////////
127 /// Sets model or disables/hides viewer.
128 
130 {
131  fPShapeObj = 0;
132 
133  fPShapeObj = static_cast<TGLPShapeObj *>(obj);
135 
140 }
141 
142 ////////////////////////////////////////////////////////////////////////////////
143 /// Set internal center data from 3 component 'c'.
144 
146 {
147  fGeomData[kCenterX]->SetNumber(c[0]);
148  fGeomData[kCenterY]->SetNumber(c[1]);
149  fGeomData[kCenterZ]->SetNumber(c[2]);
150 }
151 
152 ////////////////////////////////////////////////////////////////////////////////
153 /// Set internal scale data from 3 component 'c'.
154 
156 {
157  fGeomData[kScaleX]->SetNumber(s[0]);
158  fGeomData[kScaleY]->SetNumber(s[1]);
159  fGeomData[kScaleZ]->SetNumber(s[2]);
160 }
161 
162 ////////////////////////////////////////////////////////////////////////////////
163 /// Process 'Apply' - update the viewer object from GUI.
164 
166 {
167  TGLVertex3 trans;
168  TGLVector3 scale;
169  GetObjectData(trans.Arr(), scale.Arr());
170  if (fPShape) {
171  fPShape->SetTranslation(trans);
172  fPShape->Scale(scale);
173  }
176 }
177 
178 ////////////////////////////////////////////////////////////////////////////////
179 /// Extract the GUI object data, return center in 3 component 'center'
180 /// scale in 3 component 'scale'.
181 
183 {
184  center[0] = fGeomData[kCenterX]->GetNumber();
185  center[1] = fGeomData[kCenterY]->GetNumber();
186  center[2] = fGeomData[kCenterZ]->GetNumber();
187  scale[0] = fGeomData[kScaleX]->GetNumber();
188  scale[1] = fGeomData[kScaleY]->GetNumber();
189  scale[2] = fGeomData[kScaleZ]->GetNumber();
190 }
191 
192 ////////////////////////////////////////////////////////////////////////////////
193 /// Process setting of value in edit box - activate 'Apply' button.
194 
196 {
199 }
200 
201 ////////////////////////////////////////////////////////////////////////////////
202 /// Create GUI for setting scale and position.
203 
205 {
206  fGeoFrame = CreateEditorTabSubFrame("Geometry");
207 
208  TGLabel *label=0;
209 
210  // Postion container
211  TGGroupFrame* container = new TGGroupFrame(fGeoFrame, "Object position:");
212  container->SetTitlePos(TGGroupFrame::kLeft);
213  fGeoFrame->AddFrame(container, new TGLayoutHints(kLHintsTop | kLHintsCenterX | kLHintsExpandX, 8, 8, 3, 3));//-
215 
216  TGHorizontalFrame* hf;
217 
218  hf = new TGHorizontalFrame(container);
219  label = new TGLabel(hf, "X:");
220  hf->AddFrame(label, new TGLayoutHints(fLl));
221  fGeomData[kCenterX] = new TGNumberEntry(hf, 0.0, 8, kNExc);
223  fGeomData[kCenterX]->Connect("ValueSet(Long_t)", "TGLPShapeObjEditor",
224  this, "GeoValueSet(Long_t)");
225  container->AddFrame(hf, new TGLayoutHints(lh));
226 
227  hf = new TGHorizontalFrame(container);
228  label = new TGLabel(hf, "Y:");
229  hf->AddFrame(label, new TGLayoutHints(fLl));
230  fGeomData[kCenterY] = new TGNumberEntry(hf, 0.0, 8, kNEyc);
232  fGeomData[kCenterY]->Connect("ValueSet(Long_t)", "TGLPShapeObjEditor",
233  this, "GeoValueSet(Long_t)");
234  container->AddFrame(hf, new TGLayoutHints(lh));
235 
236  hf = new TGHorizontalFrame(container);
237  hf->AddFrame(new TGLabel(hf, "Z:"), new TGLayoutHints(fLl));
238  fGeomData[kCenterZ] = new TGNumberEntry(hf, 1.0, 8, kNEzc);
240  fGeomData[kCenterZ]->Connect("ValueSet(Long_t)", "TGLPShapeObjEditor",
241  this, "GeoValueSet(Long_t)");
242  container->AddFrame(hf, new TGLayoutHints(lh));
243 
244  // Scale container
245  TGGroupFrame* osf = new TGGroupFrame(fGeoFrame, "Object scale:", kLHintsTop | kLHintsCenterX);
248 
249  hf = new TGHorizontalFrame(osf);
250  hf->AddFrame(new TGLabel(hf, "X:"),new TGLayoutHints(fLl));
251  fGeomData[kScaleX] = new TGNumberEntry(hf, 1.0, 5, kNExs);
253  fGeomData[kScaleX]->Connect("ValueSet(Long_t)", "TGLPShapeObjEditor",
254  this, "GeoValueSet(Long_t)");
255  osf->AddFrame(hf, new TGLayoutHints(lh));
256 
257  hf = new TGHorizontalFrame(osf);
258  hf->AddFrame(new TGLabel(hf, "Y:"),new TGLayoutHints(fLl));
259  fGeomData[kScaleY] = new TGNumberEntry(hf, 1.0, 5, kNEys);
261  fGeomData[kScaleY]->Connect("ValueSet(Long_t)", "TGLPShapeObjEditor",
262  this, "GeoValueSet(Long_t)");
263  osf->AddFrame(hf, new TGLayoutHints(lh));
264 
265  hf = new TGHorizontalFrame(osf);
266  hf->AddFrame(new TGLabel(hf, "Z:"),new TGLayoutHints(fLl));
267  fGeomData[kScaleZ] = new TGNumberEntry(hf, 1.0, 5, kNEzs);
269  fGeomData[kScaleZ]->Connect("ValueSet(Long_t)", "TGLPShapeObjEditor",
270  this, "GeoValueSet(Long_t)");
271  osf->AddFrame(hf, new TGLayoutHints(lh));
272 
273  hf = new TGHorizontalFrame(osf);
277  osf->AddFrame(hf, new TGLayoutHints(lh));
278 
279  // Modify button
280  fGeoApplyButton = new TGTextButton(fGeoFrame, "Modify object");
283  fGeoApplyButton->Connect("Pressed()", "TGLPShapeObjEditor", this, "DoGeoButton()");
284 }
285 
286 ////////////////////////////////////////////////////////////////////////////////
287 /// Set color sliders from 17 component 'rgba'.
288 
290 {
293 
294  for (Int_t i = 0; i < 17; ++i) fRGBA[i] = rgba[i];
295 
296  fRedSlider->SetPosition(Int_t(fRGBA[fLMode * 4] * 100));
297  fGreenSlider->SetPosition(Int_t(fRGBA[fLMode * 4 + 1] * 100));
298  fBlueSlider->SetPosition(Int_t(fRGBA[fLMode * 4 + 2] * 100));
300 
301  DrawSphere();
302 }
303 
304 ////////////////////////////////////////////////////////////////////////////////
305 /// Process slider movement.
306 
308 {
309  TGSlider *frm = (TGSlider *)gTQSender;
310 
311  if (frm) {
312  Int_t wid = frm->WidgetId();
313 
314  switch (wid) {
315  case kHSr:
316  fRGBA[fLMode * 4] = val / 100.f;
317  break;
318  case kHSg:
319  fRGBA[fLMode * 4 + 1] = val / 100.f;
320  break;
321  case kHSb:
322  fRGBA[fLMode * 4 + 2] = val / 100.f;
323  break;
324  case kHSa:
325  fRGBA[fLMode * 4 + 3] = val / 100.f;
326  break;
327  case kHSs:
328  fRGBA[16] = val;
329  break;
330  }
331 
334  DrawSphere();
335  }
336 }
337 
338 ////////////////////////////////////////////////////////////////////////////////
339 /// Process button action.
340 
342 {
343  TGButton *btn = (TGButton *) gTQSender;
344  Int_t id = btn->WidgetId();
345 
346  switch (id) {
347  case kCPd:
349  fLMode = kDiffuse;
351  break;
352  case kCPa:
354  fLMode = kAmbient;
356  break;
357  case kCPs:
359  fLMode = kSpecular;
361  break;
362  case kCPe:
364  fLMode = kEmission;
366  break;
367  case kTBa:
370  if (fPShape) {
372  }
374  break;
375  case kTBaf:
378  if (fPShape) {
380  }
382  break;
383  }
384 }
385 
386 ////////////////////////////////////////////////////////////////////////////////
387 /// Create Diffuse/Ambient/Specular/Emissive radio buttons and sub-frames.
388 
390 {
391  TGGroupFrame *partFrame = new TGGroupFrame(fColorFrame, "Color components:", kLHintsTop | kLHintsCenterX);
392  fColorFrame->AddFrame(partFrame, new TGLayoutHints(kLHintsTop | kLHintsCenterX, 2, 0, 2, 2));
393 
394  partFrame->SetTitlePos(TGGroupFrame::kLeft);
395  TGMatrixLayout *ml = new TGMatrixLayout(partFrame, 0, 1, 10);
396  partFrame->SetLayoutManager(ml);
397 
398  // partFrame will delete the layout manager ml for us so don't add to fTrash
399  fLightTypes[kDiffuse] = new TGRadioButton(partFrame, "Diffuse", kCPd);
400  fLightTypes[kDiffuse]->Connect("Pressed()", "TGLPShapeObjEditor", this, "DoColorButton()");
401  fLightTypes[kDiffuse]->SetToolTipText("Diffuse component of color");
402  partFrame->AddFrame(fLightTypes[kDiffuse]);
403 
404  fLightTypes[kAmbient] = new TGRadioButton(partFrame, "Ambient", kCPa);
405  fLightTypes[kAmbient]->Connect("Pressed()", "TGLPShapeObjEditor", this, "DoColorButton()");
406  fLightTypes[kAmbient]->SetToolTipText("Ambient component of color");
407  partFrame->AddFrame(fLightTypes[kAmbient]);
408 
409  fLightTypes[kSpecular] = new TGRadioButton(partFrame, "Specular", kCPs);
410  fLightTypes[kSpecular]->Connect("Pressed()", "TGLPShapeObjEditor", this, "DoColorButton()");
411  fLightTypes[kSpecular]->SetToolTipText("Specular component of color");
412  partFrame->AddFrame(fLightTypes[kSpecular]);
413 
414  fLightTypes[kEmission] = new TGRadioButton(partFrame, "Emissive", kCPe);
415  fLightTypes[kEmission]->Connect("Pressed()", "TGLPShapeObjEditor", this, "DoColorButton()");
416  fLightTypes[kEmission]->SetToolTipText("Emissive component of color");
417  partFrame->AddFrame(fLightTypes[kEmission]);
418 
419  fLMode = kDiffuse;
421 }
422 
423 ////////////////////////////////////////////////////////////////////////////////
424 /// Create GUI for setting light color.
425 
427 {
428  UInt_t sw = 120; //fColorFrame->GetDefalutWidth();,
429 
430  // Create Red/Green/BlueAlpha/Shine sliders
431  fColorFrame->AddFrame(new TGLabel(fColorFrame, "Red :"), new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 0, 0, 0));
433  fRedSlider->Connect("PositionChanged(Int_t)", "TGLPShapeObjEditor", this, "DoColorSlider(Int_t)");
434  fRedSlider->SetRange(0, 100);
435  fRedSlider->SetPosition(Int_t(fRGBA[0] * 100));
437 
438 
439  fColorFrame->AddFrame(new TGLabel(fColorFrame, "Green :"), new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 0, 0, 0));
441  fGreenSlider->Connect("PositionChanged(Int_t)", "TGLPShapeObjEditor", this, "DoColorSlider(Int_t)");
442  fGreenSlider->SetRange(0, 100);
443  fGreenSlider->SetPosition(Int_t(fRGBA[1] * 100));
445 
446 
447  fColorFrame->AddFrame(new TGLabel(fColorFrame, "Blue :"), new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 0, 0, 0));
449  fBlueSlider->Connect("PositionChanged(Int_t)", "TGLPShapeObjEditor", this, "DoColorSlider(Int_t)");
450  fBlueSlider->SetRange(0, 100);
451  fBlueSlider->SetPosition(Int_t(fRGBA[2] * 100));
453 
454  fColorFrame->AddFrame(new TGLabel(fColorFrame, "Shine :"), new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 0, 0, 0));
456  fShineSlider->Connect("PositionChanged(Int_t)", "TGLPShapeObjEditor", this, "DoColorSlider(Int_t)");
457  fShineSlider->SetRange(0, 128);
459 }
460 
461 ////////////////////////////////////////////////////////////////////////////////
462 /// Update GUI sliders from internal data.
463 
465 {
466  fRedSlider->SetPosition(Int_t(fRGBA[fLMode * 4] * 100));
467  fGreenSlider->SetPosition(Int_t(fRGBA[fLMode * 4 + 1] * 100));
468  fBlueSlider->SetPosition(Int_t(fRGBA[fLMode * 4 + 2] * 100));
469  // fAlphaSlider->SetPosition(Int_t(fRGBA[fLMode * 4 + 3] * 100));
470 
471  if (fRGBA[16] >= 0.f)
473 }
474 
475 ////////////////////////////////////////////////////////////////////////////////
476 /// Redraw widget. Render sphere and pass to base-class.
477 
479 {
480  DrawSphere();
482 }
483 
484 ////////////////////////////////////////////////////////////////////////////////
485 
486 namespace {
487  GLUquadric *GetQuadric()
488  {
489  // GLU quadric.
490 
491  static struct Init {
492  Init()
493  {
494  fQuad = gluNewQuadric();
495  if (!fQuad) {
496  Error("GetQuadric::Init", "could not create quadric object");
497  } else {
498  gluQuadricOrientation(fQuad, (GLenum)GLU_OUTSIDE);
499  gluQuadricDrawStyle(fQuad, (GLenum)GLU_FILL);
500  gluQuadricNormals(fQuad, (GLenum)GLU_FLAT);
501  }
502  }
503  ~Init()
504  {
505  if(fQuad)
506  gluDeleteQuadric(fQuad);
507  }
508  GLUquadric *fQuad;
509  }singleton;
510 
511  return singleton.fQuad;
512  }
513 
514 }
515 
516 ////////////////////////////////////////////////////////////////////////////////
517 /// Draw local sphere reflecting current color options.
518 
520 {
521  if (!gVirtualX->IsCmdThread()) {
522  gROOT->ProcessLineFast(Form("((TGLPShapeObjEditor *)0x%lx)->DrawSphere()", (ULong_t)this));
523  return;
524  }
525 
527 
529  glViewport(0, 0, fMatView->GetWidth(), fMatView->GetHeight());
530  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
531 
532  glEnable(GL_LIGHTING);
533  glEnable(GL_LIGHT0);
534  glEnable(GL_DEPTH_TEST);
535  glEnable(GL_CULL_FACE);
536  glCullFace(GL_BACK);
537  glMatrixMode(GL_PROJECTION);
538  glLoadIdentity();
539  glFrustum(-0.5, 0.5, -0.5, 0.5, 1., 10.);
540  glMatrixMode(GL_MODELVIEW);
541  glLoadIdentity();
542  Float_t ligPos[] = {0.f, 0.f, 0.f, 1.f};
543  glLightfv(GL_LIGHT0, GL_POSITION, ligPos);
544  glTranslated(0., 0., -3.);
545 
546  const Float_t whiteColor[] = {1.f, 1.f, 1.f, 1.f};
547  const Float_t nullColor[] = {0.f, 0.f, 0.f, 1.f};
548 
549  if (fRGBA[16] < 0.f) {
550  glLightfv(GL_LIGHT0, GL_DIFFUSE, fRGBA);
551  glLightfv(GL_LIGHT0, GL_AMBIENT, fRGBA + 4);
552  glLightfv(GL_LIGHT0, GL_SPECULAR, fRGBA + 8);
553  glMaterialfv(GL_FRONT, GL_DIFFUSE, whiteColor);
554  glMaterialfv(GL_FRONT, GL_AMBIENT, nullColor);
555  glMaterialfv(GL_FRONT, GL_SPECULAR, whiteColor);
556  glMaterialfv(GL_FRONT, GL_EMISSION, nullColor);
557  glMaterialf(GL_FRONT, GL_SHININESS, 60.f);
558  } else {
559  glLightfv(GL_LIGHT0, GL_DIFFUSE, whiteColor);
560  glLightfv(GL_LIGHT0, GL_AMBIENT, nullColor);
561  glLightfv(GL_LIGHT0, GL_SPECULAR, whiteColor);
562  glMaterialfv(GL_FRONT, GL_DIFFUSE, fRGBA);
563  glMaterialfv(GL_FRONT, GL_AMBIENT, fRGBA + 4);
564  glMaterialfv(GL_FRONT, GL_SPECULAR, fRGBA + 8);
565  glMaterialfv(GL_FRONT, GL_EMISSION, fRGBA + 12);
566  glMaterialf(GL_FRONT, GL_SHININESS, fRGBA[16]);
567  }
568 
569  glEnable(GL_BLEND);
570  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
571  GLUquadric * quad = GetQuadric();
572  if (quad) {
573  glRotated(-90., 1., 0., 0.);
574  gluSphere(quad, 1., 100, 100);
575  }
576  glDisable(GL_BLEND);
577 
579 }
580 
581 ////////////////////////////////////////////////////////////////////////////////
582 /// Create widgets to chose colors component and its RGBA values on fGedEditor
583 /// model or family it belongs to.
584 
586 {
587  fColorFrame = this;
588 
591 
593 
595 
596  //apply button creation
600  fColorApplyButton->Connect("Pressed()", "TGLPShapeObjEditor", this, "DoColorButton()");
601  //apply to family button creation
602  fColorApplyFamily = new TGTextButton(fColorFrame, "Apply to family", kTBaf);
605  fColorApplyFamily->Connect("Pressed()", "TGLPShapeObjEditor", this, "DoColorButton()");
606 }
virtual TVirtualPad * GetPad() const
Definition: TGedEditor.h:89
virtual void PShapeModified()
Shape has been modified.
void SetColorOnFamily(const Float_t rgba[17])
Set full color attributes to all physicals sharing the same logical with this object.
TGLViewer * fViewer
Definition: TGLPShapeObj.h:24
Wrap TGLPysicalShape into TObject so that it can be edited using GED.
Definition: TGLPShapeObj.h:20
float Float_t
Definition: RtypesCore.h:53
virtual void SetRange(Int_t min, Int_t max)
Definition: TGSlider.h:101
GUI editor for TGLPShapeObj.
R__EXTERN void * gTQSender
Definition: TQObject.h:45
UInt_t GetHeight() const
Definition: TGFrame.h:272
Int_t WidgetId() const
Definition: TGWidget.h:80
virtual void SetNumber(Double_t val)
#define gROOT
Definition: TROOT.h:375
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
Definition: TGFrame.cxx:982
int Int_t
Definition: RtypesCore.h:41
R__EXTERN TVirtualMutex * gROOTMutex
Definition: TROOT.h:57
TGLPShapeObj * fPShapeObj
virtual void SetLimits(ELimit limits=TGNumberFormat::kNELNoLimits, Double_t min=0, Double_t max=1)
virtual void DoRedraw()
Redraw widget. Render sphere and pass to base-class.
TGCompositeFrame * fGeoFrame
TGButton * fLightTypes[4]
UInt_t GetWidth() const
Definition: TGFrame.h:271
virtual void SetPShape(TGLPhysicalShape *shape)
Shape has changed.
Concrete physical shape - a GL drawable.
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:83
virtual void DoRedraw()
Redraw the frame.
Definition: TGFrame.cxx:412
virtual void SetTitlePos(ETitlePos pos=kLeft)
Definition: TGFrame.h:651
virtual TObject * GetModel() const
Definition: TGedEditor.h:90
void SetColor(const Float_t rgba[17])
Set full color attributes - see OpenGL material documentation for full description.
ULong_t Pixel_t
Definition: GuiTypes.h:39
3 component (x/y/z) vertex class.
Definition: TGLUtil.h:82
TGButton * fColorApplyButton
virtual TGVerticalFrame * CreateEditorTabSubFrame(const char *name)
Create a vertical frame to be used by &#39;owner&#39; in extra tab &#39;name&#39;.
Definition: TGedFrame.cxx:123
TGLVector3 GetScale() const
void CreateColorControls()
Create widgets to chose colors component and its RGBA values on fGedEditor model or family it belongs...
virtual void SetModel(TObject *obj)
Sets model or disables/hides viewer.
3 component (x/y/z) vector class.
Definition: TGLUtil.h:246
const Float_t * Color() const
virtual EButtonState GetState() const
Definition: TGButton.h:112
void GetObjectData(Double_t *shift, Double_t *scale)
Extract the GUI object data, return center in 3 component &#39;center&#39; scale in 3 component &#39;scale&#39;...
void SetScale(const Double_t *scale)
Set internal scale data from 3 component &#39;c&#39;.
void SwapBuffers()
Swap buffers.
Definition: TGLWidget.cxx:217
TGButton * fColorApplyFamily
TGLPhysicalShape * fPShape
Definition: TGLPShapeObj.h:23
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot...
Definition: TQObject.cxx:867
void RequestDraw(Short_t LOD=TGLRnrCtx::kLODMed)
Post request for redraw of viewer at level of detail &#39;LOD&#39; Request is directed via cross thread gVirt...
Definition: TGLViewer.cxx:436
void SetRGBA(const Float_t *rgba)
Set color sliders from 17 component &#39;rgba&#39;.
Double_t * Arr()
Definition: TGLUtil.h:126
void DoColorButton()
Process button action.
unsigned int UInt_t
Definition: RtypesCore.h:42
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:873
char * Form(const char *fmt,...)
virtual void SetPosition(Int_t pos)
Definition: TGSlider.h:105
TGCompositeFrame * fColorFrame
TGLPShapeObjEditor(const TGWindow *p=0, Int_t width=140, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Constructor of TGLPhysicalShape editor GUI.
void DrawSphere() const
Draw local sphere reflecting current color options.
#define gVirtualX
Definition: TVirtualX.h:350
#define R__LOCKGUARD2(mutex)
TGNumberEntry * fGeomData[6]
const Bool_t kFALSE
Definition: RtypesCore.h:92
TGLVertex3 GetTranslation() const
void SetCenter(const Double_t *center)
Set internal center data from 3 component &#39;c&#39;.
Bool_t MakeCurrent()
Make the gl-context current.
Definition: TGLWidget.cxx:201
long Long_t
Definition: RtypesCore.h:50
void Scale(const TGLVector3 &scale)
virtual void SetPShape(TGLPhysicalShape *shape)
Set the shape.
#define ClassImp(name)
Definition: Rtypes.h:336
double f(double x)
double Double_t
Definition: RtypesCore.h:55
virtual Double_t GetNumber() const
void CreateGeoControls()
Create GUI for setting scale and position.
void CreateColorSliders()
Create GUI for setting light color.
unsigned long ULong_t
Definition: RtypesCore.h:51
void DoGeoButton()
Process &#39;Apply&#39; - update the viewer object from GUI.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1099
virtual void SetModel(TVirtualPad *pad, TObject *obj, Int_t event, Bool_t force=kFALSE)
Activate object editors according to the selected object.
Definition: TGedEditor.cxx:349
TGLPhysicalShape * fPShape
Definition: TGLPShapeRef.h:29
Mother of all ROOT objects.
Definition: TObject.h:37
const Double_t * CArr() const
Definition: TGLUtil.h:125
EApplyButtonIds
EGLEditorIdent
void GeoValueSet(Long_t unusedVal)
Process setting of value in edit box - activate &#39;Apply&#39; button.
void SetTranslation(const TGLVertex3 &translation)
~TGLPShapeObjEditor()
Destroy color editor GUI component.
void SetColorSlidersPos()
Update GUI sliders from internal data.
TGedEditor * fGedEditor
Definition: TGedFrame.h:54
const Bool_t kTRUE
Definition: RtypesCore.h:91
virtual void SetToolTipText(const char *text, Long_t delayms=400)
Set tool tip text associated with this button.
Definition: TGButton.cxx:395
void DoColorSlider(Int_t val)
Process slider movement.
const Float_t * GetRGBA() const
void CreateColorRadioButtons()
Create Diffuse/Ambient/Specular/Emissive radio buttons and sub-frames.
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition: TGButton.cxx:185