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 virtual void DoRedraw();
74
75public:
76 TGLPShapeObjEditor(const TGWindow *p = 0,
77 Int_t width = 140, Int_t height = 30,
78 UInt_t options = kChildFrame,
81
82 // Virtuals from TGLPShapeRef
83 virtual void SetPShape(TGLPhysicalShape * shape);
84 virtual void PShapeModified();
85
86 virtual void SetModel(TObject* obj);
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 ClassDef(TGLPShapeObjEditor, 0); //GUI for editing attributes of a physical-shape.
108};
109
110#endif
@ kChildFrame
Definition GuiTypes.h:379
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
Handle_t Window_t
Window handle.
Definition GuiTypes.h:29
int Int_t
Definition RtypesCore.h:45
unsigned long ULong_t
Definition RtypesCore.h:55
long Long_t
Definition RtypesCore.h:54
double Double_t
Definition RtypesCore.h:59
float Float_t
Definition RtypesCore.h:57
#define ClassDef(name, id)
Definition Rtypes.h:325
include TDocParser_001 C image html pict1_TDocParser_001 png width
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition TGFrame.cxx:668
GUI editor for TGLPShapeObj.
void SetColorSlidersPos()
Update GUI sliders from internal data.
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.
virtual void PShapeModified()
Shape has been modified.
~TGLPShapeObjEditor()
Destroy color editor GUI component.
void SetScale(const Double_t *scale)
Set internal scale data from 3 component 'c'.
TGLPShapeObj * fPShapeObj
void DoColorButton()
Process button action.
void DrawSphere() const
Draw local sphere reflecting current color options.
virtual void DoRedraw()
Redraw widget. Render sphere and pass to base-class.
void CreateColorControls()
Create widgets to chose colors component and its RGBA values on fGedEditor model or family it belongs...
virtual void SetPShape(TGLPhysicalShape *shape)
Shape has changed.
TGCompositeFrame * fGeoFrame
virtual void SetModel(TObject *obj)
Sets model or disables/hides viewer.
const Float_t * GetRGBA() const
void SetRGBA(const Float_t *rgba)
Set color sliders from 17 component 'rgba'.
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
Definition TGTab.h:62
Mother of all ROOT objects.
Definition TObject.h:37