ROOT logo
// @(#)root/gl:$Id: TGLPShapeObjEditor.h 28197 2009-04-14 13:59:27Z matevz $
// Author: Matevz Tadel   25/09/2006

#ifndef ROOT_TGLPShapeObjEditor
#define ROOT_TGLPShapeObjEditor

#include <memory>

#ifndef ROOT_TGedFrame
#include "TGedFrame.h"
#endif

#ifndef ROOT_TGLUtil
#include "TGLUtil.h"
#endif

#include "TGLPShapeRef.h"

class TGLPShapeObj;
class TGLayoutHints;
class TGCheckButton;
class TGNumberEntry;
class TGButtonGroup;
class TGroupFrame;
class TGHSlider;
class TGRadioButton;
class TGTabElement;
class TGButton;
class TGLViewer;
class TGTab;

class TGLWidget;

class TGLPShapeObjEditor : public TGedFrame,
                           public TGLPShapeRef
{

private:
   enum ELightMode   { kDiffuse, kAmbient, kSpecular, kEmission };
   ELightMode        fLMode;

   TGLayoutHints     fLb;  //button layout
   TGLayoutHints     fLe;  //num entry layout
   TGLayoutHints     fLl;  //label layout
   TGLayoutHints     fLs;  //slider layout

   TGCompositeFrame *fGeoFrame;          //orientation, clipping

   // "Geometry" tab's controls
   TGNumberEntry    *fGeomData[6];       //position and clipping control
   TGButton         *fGeoApplyButton;    //action button

   // "Color" tab's controls
   TGCompositeFrame *fColorFrame;        //top frame for color componet control
   TGLWidget        *fMatView;           //inner structure to handle sphere GL window

   TGButton         *fLightTypes[4];     //light type

   TGHSlider        *fRedSlider;         //red component of selected material
   TGHSlider        *fGreenSlider;       //green component of selected material
   TGHSlider        *fBlueSlider;        //blue component of selected material
   TGHSlider        *fAlphaSlider;       //alpha component of selected material lider;
   TGHSlider        *fShineSlider;       //specular refelction of selected material

   TGButton         *fColorApplyButton;  //apply to selected
   TGButton         *fColorApplyFamily;  //apply to selected and family
   Float_t           fRGBA[17];          //color multiplet

   Window_t          fGLWin;             //GL window with sphere
   ULong_t           fCtx;               //GL context

   TGLPShapeObj     *fPShapeObj;         //model

   void CreateGeoControls();
   void CreateColorControls();

   virtual void DoRedraw();

public:
   TGLPShapeObjEditor(const TGWindow *p = 0,
                      Int_t width = 140, Int_t height = 30,
                      UInt_t options = kChildFrame,
                      Pixel_t back = GetDefaultFrameBackground());
   ~TGLPShapeObjEditor();

   // Virtuals from TGLPShapeRef
   virtual void SetPShape(TGLPhysicalShape * shape);
   virtual void PShapeModified();

   virtual void SetModel(TObject* obj);

   // geometry
   void SetCenter(const Double_t *center);
   void SetScale(const Double_t *scale);
   void DoGeoButton();
   void GetObjectData(Double_t *shift, Double_t *scale);
   void GeoValueSet(Long_t unusedVal);
   //colors
   void CreateColorRadioButtons();
   void CreateColorSliders();
   void SetColorSlidersPos();

   void DrawSphere()const;

   void SetRGBA(const Float_t *rgba);
   const Float_t *GetRGBA()const{return fRGBA;}
   //color slots
   void DoColorSlider(Int_t val);
   void DoColorButton();

   ClassDef(TGLPShapeObjEditor, 0); //GUI for editing attributes of a physical-shape.
};

#endif
 TGLPShapeObjEditor.h:1
 TGLPShapeObjEditor.h:2
 TGLPShapeObjEditor.h:3
 TGLPShapeObjEditor.h:4
 TGLPShapeObjEditor.h:5
 TGLPShapeObjEditor.h:6
 TGLPShapeObjEditor.h:7
 TGLPShapeObjEditor.h:8
 TGLPShapeObjEditor.h:9
 TGLPShapeObjEditor.h:10
 TGLPShapeObjEditor.h:11
 TGLPShapeObjEditor.h:12
 TGLPShapeObjEditor.h:13
 TGLPShapeObjEditor.h:14
 TGLPShapeObjEditor.h:15
 TGLPShapeObjEditor.h:16
 TGLPShapeObjEditor.h:17
 TGLPShapeObjEditor.h:18
 TGLPShapeObjEditor.h:19
 TGLPShapeObjEditor.h:20
 TGLPShapeObjEditor.h:21
 TGLPShapeObjEditor.h:22
 TGLPShapeObjEditor.h:23
 TGLPShapeObjEditor.h:24
 TGLPShapeObjEditor.h:25
 TGLPShapeObjEditor.h:26
 TGLPShapeObjEditor.h:27
 TGLPShapeObjEditor.h:28
 TGLPShapeObjEditor.h:29
 TGLPShapeObjEditor.h:30
 TGLPShapeObjEditor.h:31
 TGLPShapeObjEditor.h:32
 TGLPShapeObjEditor.h:33
 TGLPShapeObjEditor.h:34
 TGLPShapeObjEditor.h:35
 TGLPShapeObjEditor.h:36
 TGLPShapeObjEditor.h:37
 TGLPShapeObjEditor.h:38
 TGLPShapeObjEditor.h:39
 TGLPShapeObjEditor.h:40
 TGLPShapeObjEditor.h:41
 TGLPShapeObjEditor.h:42
 TGLPShapeObjEditor.h:43
 TGLPShapeObjEditor.h:44
 TGLPShapeObjEditor.h:45
 TGLPShapeObjEditor.h:46
 TGLPShapeObjEditor.h:47
 TGLPShapeObjEditor.h:48
 TGLPShapeObjEditor.h:49
 TGLPShapeObjEditor.h:50
 TGLPShapeObjEditor.h:51
 TGLPShapeObjEditor.h:52
 TGLPShapeObjEditor.h:53
 TGLPShapeObjEditor.h:54
 TGLPShapeObjEditor.h:55
 TGLPShapeObjEditor.h:56
 TGLPShapeObjEditor.h:57
 TGLPShapeObjEditor.h:58
 TGLPShapeObjEditor.h:59
 TGLPShapeObjEditor.h:60
 TGLPShapeObjEditor.h:61
 TGLPShapeObjEditor.h:62
 TGLPShapeObjEditor.h:63
 TGLPShapeObjEditor.h:64
 TGLPShapeObjEditor.h:65
 TGLPShapeObjEditor.h:66
 TGLPShapeObjEditor.h:67
 TGLPShapeObjEditor.h:68
 TGLPShapeObjEditor.h:69
 TGLPShapeObjEditor.h:70
 TGLPShapeObjEditor.h:71
 TGLPShapeObjEditor.h:72
 TGLPShapeObjEditor.h:73
 TGLPShapeObjEditor.h:74
 TGLPShapeObjEditor.h:75
 TGLPShapeObjEditor.h:76
 TGLPShapeObjEditor.h:77
 TGLPShapeObjEditor.h:78
 TGLPShapeObjEditor.h:79
 TGLPShapeObjEditor.h:80
 TGLPShapeObjEditor.h:81
 TGLPShapeObjEditor.h:82
 TGLPShapeObjEditor.h:83
 TGLPShapeObjEditor.h:84
 TGLPShapeObjEditor.h:85
 TGLPShapeObjEditor.h:86
 TGLPShapeObjEditor.h:87
 TGLPShapeObjEditor.h:88
 TGLPShapeObjEditor.h:89
 TGLPShapeObjEditor.h:90
 TGLPShapeObjEditor.h:91
 TGLPShapeObjEditor.h:92
 TGLPShapeObjEditor.h:93
 TGLPShapeObjEditor.h:94
 TGLPShapeObjEditor.h:95
 TGLPShapeObjEditor.h:96
 TGLPShapeObjEditor.h:97
 TGLPShapeObjEditor.h:98
 TGLPShapeObjEditor.h:99
 TGLPShapeObjEditor.h:100
 TGLPShapeObjEditor.h:101
 TGLPShapeObjEditor.h:102
 TGLPShapeObjEditor.h:103
 TGLPShapeObjEditor.h:104
 TGLPShapeObjEditor.h:105
 TGLPShapeObjEditor.h:106
 TGLPShapeObjEditor.h:107
 TGLPShapeObjEditor.h:108
 TGLPShapeObjEditor.h:109
 TGLPShapeObjEditor.h:110
 TGLPShapeObjEditor.h:111
 TGLPShapeObjEditor.h:112
 TGLPShapeObjEditor.h:113
 TGLPShapeObjEditor.h:114