Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGLPShapeObjEditor.h
Go to the documentation of this file.
1// @(#)root/gl:$Id$
2// Author: Matevz Tadel 25/09/2006
3
4#ifndef ROOT_TGLPShapeObjEditor
5#define ROOT_TGLPShapeObjEditor
6
7#include <memory>
8
9#include "TGedFrame.h"
10
11#include "TGLUtil.h"
12
13#include "TGLPShapeRef.h"
14
15class TGLPShapeObj;
16class TGLayoutHints;
17class TGCheckButton;
18class TGNumberEntry;
19class TGButtonGroup;
20class TGroupFrame;
21class TGHSlider;
22class TGRadioButton;
23class TGTabElement;
24class TGButton;
25class TGLViewer;
26class TGTab;
27
28class TGLWidget;
29
31 public TGLPShapeRef
32{
33
34private:
37
38 TGLayoutHints fLb; //button layout
39 TGLayoutHints fLe; //num entry layout
40 TGLayoutHints fLl; //label layout
41 TGLayoutHints fLs; //slider layout
42
43 TGCompositeFrame *fGeoFrame; //orientation, clipping
44
45 // "Geometry" tab's controls
46 TGNumberEntry *fGeomData[6]; //position and clipping control
47 TGButton *fGeoApplyButton; //action button
48
49 // "Color" tab's controls
50 TGCompositeFrame *fColorFrame; //top frame for color componet control
51 TGLWidget *fMatView; //inner structure to handle sphere GL window
52
53 TGButton *fLightTypes[4]; //light type
54
55 TGHSlider *fRedSlider; //red component of selected material
56 TGHSlider *fGreenSlider; //green component of selected material
57 TGHSlider *fBlueSlider; //blue component of selected material
58 TGHSlider *fAlphaSlider; //alpha component of selected material lider;
59 TGHSlider *fShineSlider; //specular refelction of selected material
60
61 TGButton *fColorApplyButton; //apply to selected
62 TGButton *fColorApplyFamily; //apply to selected and family
63 Float_t fRGBA[17]; //color multiplet
64
65 Window_t fGLWin; //GL window with sphere
66 ULong_t fCtx; //GL context
67
69
70 void CreateGeoControls();
72
73 void DoRedraw() override;
74
75public:
76 TGLPShapeObjEditor(const TGWindow *p = nullptr,
77 Int_t width = 140, Int_t height = 30,
78 UInt_t options = kChildFrame,
80 ~TGLPShapeObjEditor() override;
81
82 // Virtuals from TGLPShapeRef
83 void SetPShape(TGLPhysicalShape * shape) override;
84 void PShapeModified() override;
85
86 void SetModel(TObject* obj) override;
87
88 // geometry
89 void SetCenter(const Double_t *center);
90 void SetScale(const Double_t *scale);
91 void DoGeoButton();
92 void GetObjectData(Double_t *shift, Double_t *scale);
93 void GeoValueSet(Long_t unusedVal);
94 //colors
96 void CreateColorSliders();
97 void SetColorSlidersPos();
98
99 void DrawSphere()const;
100
101 void SetRGBA(const Float_t *rgba);
102 const Float_t *GetRGBA()const{return fRGBA;}
103 //color slots
104 void DoColorSlider(Int_t val);
105 void DoColorButton();
106
107 ClassDefOverride(TGLPShapeObjEditor, 0); //GUI for editing attributes of a physical-shape.
108};
109
110#endif
Handle_t Window_t
Window handle.
Definition GuiTypes.h:29
@ kChildFrame
Definition GuiTypes.h:379
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
int Int_t
Definition RtypesCore.h:45
unsigned long ULong_t
Definition RtypesCore.h:55
long Long_t
Definition RtypesCore.h:54
float Float_t
Definition RtypesCore.h:57
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t width
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
Organizes TGButton widgets in a group.
A button abstract base class.
Definition TGButton.h:68
Selects different options.
Definition TGButton.h:264
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:287
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition TGFrame.cxx:683
Concrete class for horizontal slider.
Definition TGSlider.h:119
GUI editor for TGLPShapeObj.
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
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.
Base class for references to TGLPysicalShape that need to be notified when the shape is destroyed.
Concrete physical shape - a GL drawable.
Base GL viewer object - used by both standalone and embedded (in pad) GL.
Definition TGLViewer.h:55
GL window with context.
Definition TGLWidget.h:28
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
TGNumberEntry is a number entry input widget with up/down buttons.
Selects different options.
Definition TGButton.h:321
Service classes of the tab widget.
Definition TGTab.h:117
A tab widget contains a set of composite frames each with a little tab with a name (like a set of fol...
Definition TGTab.h:46
ROOT GUI Window base class.
Definition TGWindow.h:23
Base frame for implementing GUI - a service class.
Definition TGedFrame.h:27
Mother of all ROOT objects.
Definition TObject.h:41