Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TGLPShapeObjEditor.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/gl:$Id$
0002 // Author: Matevz Tadel   25/09/2006
0003 
0004 #ifndef ROOT_TGLPShapeObjEditor
0005 #define ROOT_TGLPShapeObjEditor
0006 
0007 #include <memory>
0008 
0009 #include "TGedFrame.h"
0010 
0011 #include "TGLUtil.h"
0012 
0013 #include "TGLPShapeRef.h"
0014 
0015 class TGLPShapeObj;
0016 class TGLayoutHints;
0017 class TGCheckButton;
0018 class TGNumberEntry;
0019 class TGButtonGroup;
0020 class TGroupFrame;
0021 class TGHSlider;
0022 class TGRadioButton;
0023 class TGTabElement;
0024 class TGButton;
0025 class TGLViewer;
0026 class TGTab;
0027 
0028 class TGLWidget;
0029 
0030 class TGLPShapeObjEditor : public TGedFrame,
0031                            public TGLPShapeRef
0032 {
0033 
0034 private:
0035    enum ELightMode   { kDiffuse, kAmbient, kSpecular, kEmission };
0036    ELightMode        fLMode;
0037 
0038    TGLayoutHints     fLb;  //button layout
0039    TGLayoutHints     fLe;  //num entry layout
0040    TGLayoutHints     fLl;  //label layout
0041    TGLayoutHints     fLs;  //slider layout
0042 
0043    TGCompositeFrame *fGeoFrame;          //orientation, clipping
0044 
0045    // "Geometry" tab's controls
0046    TGNumberEntry    *fGeomData[6];       //position and clipping control
0047    TGButton         *fGeoApplyButton;    //action button
0048 
0049    // "Color" tab's controls
0050    TGCompositeFrame *fColorFrame;        //top frame for color componet control
0051    TGLWidget        *fMatView;           //inner structure to handle sphere GL window
0052 
0053    TGButton         *fLightTypes[4];     //light type
0054 
0055    TGHSlider        *fRedSlider;         //red component of selected material
0056    TGHSlider        *fGreenSlider;       //green component of selected material
0057    TGHSlider        *fBlueSlider;        //blue component of selected material
0058    TGHSlider        *fAlphaSlider;       //alpha component of selected material lider;
0059    TGHSlider        *fShineSlider;       //specular refelction of selected material
0060 
0061    TGButton         *fColorApplyButton;  //apply to selected
0062    TGButton         *fColorApplyFamily;  //apply to selected and family
0063    Float_t           fRGBA[17];          //color multiplet
0064 
0065    Window_t          fGLWin;             //GL window with sphere
0066    ULong_t           fCtx;               //GL context
0067 
0068    TGLPShapeObj     *fPShapeObj;         //model
0069 
0070    void CreateGeoControls();
0071    void CreateColorControls();
0072 
0073    void DoRedraw() override;
0074 
0075 public:
0076    TGLPShapeObjEditor(const TGWindow *p = nullptr,
0077                       Int_t width = 140, Int_t height = 30,
0078                       UInt_t options = kChildFrame,
0079                       Pixel_t back = GetDefaultFrameBackground());
0080    ~TGLPShapeObjEditor() override;
0081 
0082    // Virtuals from TGLPShapeRef
0083    void SetPShape(TGLPhysicalShape * shape) override;
0084    void PShapeModified() override;
0085 
0086    void SetModel(TObject* obj) override;
0087 
0088    // geometry
0089    void SetCenter(const Double_t *center);
0090    void SetScale(const Double_t *scale);
0091    void DoGeoButton();
0092    void GetObjectData(Double_t *shift, Double_t *scale);
0093    void GeoValueSet(Long_t unusedVal);
0094    //colors
0095    void CreateColorRadioButtons();
0096    void CreateColorSliders();
0097    void SetColorSlidersPos();
0098 
0099    void DrawSphere()const;
0100 
0101    void SetRGBA(const Float_t *rgba);
0102    const Float_t *GetRGBA()const{return fRGBA;}
0103    //color slots
0104    void DoColorSlider(Int_t val);
0105    void DoColorButton();
0106 
0107    ClassDefOverride(TGLPShapeObjEditor, 0); //GUI for editing attributes of a physical-shape.
0108 };
0109 
0110 #endif