TGLPShapeObjEditor.h

Go to the documentation of this file.
00001 // @(#)root/gl:$Id: TGLPShapeObjEditor.h 28197 2009-04-14 13:59:27Z matevz $
00002 // Author: Matevz Tadel   25/09/2006
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;  //button layout
00043    TGLayoutHints     fLe;  //num entry layout
00044    TGLayoutHints     fLl;  //label layout
00045    TGLayoutHints     fLs;  //slider layout
00046 
00047    TGCompositeFrame *fGeoFrame;          //orientation, clipping
00048 
00049    // "Geometry" tab's controls
00050    TGNumberEntry    *fGeomData[6];       //position and clipping control
00051    TGButton         *fGeoApplyButton;    //action button
00052 
00053    // "Color" tab's controls
00054    TGCompositeFrame *fColorFrame;        //top frame for color componet control
00055    TGLWidget        *fMatView;           //inner structure to handle sphere GL window
00056 
00057    TGButton         *fLightTypes[4];     //light type
00058 
00059    TGHSlider        *fRedSlider;         //red component of selected material
00060    TGHSlider        *fGreenSlider;       //green component of selected material
00061    TGHSlider        *fBlueSlider;        //blue component of selected material
00062    TGHSlider        *fAlphaSlider;       //alpha component of selected material lider;
00063    TGHSlider        *fShineSlider;       //specular refelction of selected material
00064 
00065    TGButton         *fColorApplyButton;  //apply to selected
00066    TGButton         *fColorApplyFamily;  //apply to selected and family
00067    Float_t           fRGBA[17];          //color multiplet
00068 
00069    Window_t          fGLWin;             //GL window with sphere
00070    ULong_t           fCtx;               //GL context
00071 
00072    TGLPShapeObj     *fPShapeObj;         //model
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    // Virtuals from TGLPShapeRef
00087    virtual void SetPShape(TGLPhysicalShape * shape);
00088    virtual void PShapeModified();
00089 
00090    virtual void SetModel(TObject* obj);
00091 
00092    // geometry
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    //colors
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    //color slots
00108    void DoColorSlider(Int_t val);
00109    void DoColorButton();
00110 
00111    ClassDef(TGLPShapeObjEditor, 0); //GUI for editing attributes of a physical-shape.
00112 };
00113 
00114 #endif

Generated on Tue Jul 5 14:16:52 2011 for ROOT_528-00b_version by  doxygen 1.5.1