00001
00002
00003
00004 #ifndef ROOT_TGLPShapeObjEditor
00005 #define ROOT_TGLPShapeObjEditor
00006
00007 #include <memory>
00008
00009 #ifndef ROOT_TGedFrame
00010 #include "TGedFrame.h"
00011 #endif
00012
00013 #ifndef ROOT_TGLUtil
00014 #include "TGLUtil.h"
00015 #endif
00016
00017 #include "TGLPShapeRef.h"
00018
00019 class TGLPShapeObj;
00020 class TGLayoutHints;
00021 class TGCheckButton;
00022 class TGNumberEntry;
00023 class TGButtonGroup;
00024 class TGroupFrame;
00025 class TGHSlider;
00026 class TGRadioButton;
00027 class TGTabElement;
00028 class TGButton;
00029 class TGLViewer;
00030 class TGTab;
00031
00032 class TGLWidget;
00033
00034 class TGLPShapeObjEditor : public TGedFrame,
00035 public TGLPShapeRef
00036 {
00037
00038 private:
00039 enum ELightMode { kDiffuse, kAmbient, kSpecular, kEmission };
00040 ELightMode fLMode;
00041
00042 TGLayoutHints fLb;
00043 TGLayoutHints fLe;
00044 TGLayoutHints fLl;
00045 TGLayoutHints fLs;
00046
00047 TGCompositeFrame *fGeoFrame;
00048
00049
00050 TGNumberEntry *fGeomData[6];
00051 TGButton *fGeoApplyButton;
00052
00053
00054 TGCompositeFrame *fColorFrame;
00055 TGLWidget *fMatView;
00056
00057 TGButton *fLightTypes[4];
00058
00059 TGHSlider *fRedSlider;
00060 TGHSlider *fGreenSlider;
00061 TGHSlider *fBlueSlider;
00062 TGHSlider *fAlphaSlider;
00063 TGHSlider *fShineSlider;
00064
00065 TGButton *fColorApplyButton;
00066 TGButton *fColorApplyFamily;
00067 Float_t fRGBA[17];
00068
00069 Window_t fGLWin;
00070 ULong_t fCtx;
00071
00072 TGLPShapeObj *fPShapeObj;
00073
00074 void CreateGeoControls();
00075 void CreateColorControls();
00076
00077 virtual void DoRedraw();
00078
00079 public:
00080 TGLPShapeObjEditor(const TGWindow *p = 0,
00081 Int_t width = 140, Int_t height = 30,
00082 UInt_t options = kChildFrame,
00083 Pixel_t back = GetDefaultFrameBackground());
00084 ~TGLPShapeObjEditor();
00085
00086
00087 virtual void SetPShape(TGLPhysicalShape * shape);
00088 virtual void PShapeModified();
00089
00090 virtual void SetModel(TObject* obj);
00091
00092
00093 void SetCenter(const Double_t *center);
00094 void SetScale(const Double_t *scale);
00095 void DoGeoButton();
00096 void GetObjectData(Double_t *shift, Double_t *scale);
00097 void GeoValueSet(Long_t unusedVal);
00098
00099 void CreateColorRadioButtons();
00100 void CreateColorSliders();
00101 void SetColorSlidersPos();
00102
00103 void DrawSphere()const;
00104
00105 void SetRGBA(const Float_t *rgba);
00106 const Float_t *GetRGBA()const{return fRGBA;}
00107
00108 void DoColorSlider(Int_t val);
00109 void DoColorButton();
00110
00111 ClassDef(TGLPShapeObjEditor, 0);
00112 };
00113
00114 #endif