TGeoPconEditor.h

Go to the documentation of this file.
00001 // @(#):$Id: TGeoPconEditor.h 21425 2007-12-17 15:59:27Z brun $
00002 // Author: M.Gheata 
00003 /*************************************************************************
00004  * Copyright (C) 1995-2002, Rene Brun and Fons Rademakers.               *
00005  * All rights reserved.                                                  *
00006  *                                                                       *
00007  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00008  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00009  *************************************************************************/
00010 
00011 #ifndef ROOT_TGeoPconEditor
00012 #define ROOT_TGeoPconEditor
00013 
00014 //////////////////////////////////////////////////////////////////////////
00015 //                                                                      //
00016 //  TGeoPconEditor                                                      //
00017 //                                                                      //
00018 //  Editor for a TGeoPcon.                                              //
00019 //                                                                      //
00020 //////////////////////////////////////////////////////////////////////////
00021 
00022 #ifndef ROOT_TGButton
00023 #include "TGWidget.h"
00024 #endif
00025 #ifndef ROOT_TGeoGedFrame
00026 #include "TGeoGedFrame.h"
00027 #endif
00028 
00029 class TGeoPcon;
00030 class TGeoPconSection;
00031 class TGeoTabManager;
00032 class TGTextEntry;
00033 class TGNumberEntry;
00034 class TGTab;
00035 class TGComboBox;
00036 class TGTextButton;
00037 class TGCheckButton;
00038 class TGCanvas;
00039 class TString;
00040 
00041 class TGeoPconEditor : public TGeoGedFrame {
00042 
00043 protected:
00044    Int_t                fNsecti;            // Initial number of sections
00045    Double_t             fPhi1i;             // Initial Phi1
00046    Double_t             fDPhii;             // Initial Dphi
00047    Double_t            *fZi;                // Initial Z positions
00048    Double_t            *fRmini;             // Initial Rmin values
00049    Double_t            *fRmaxi;             // Initial Rmax values   
00050    Int_t                fNsections;         // Number of Z sections
00051    TObjArray           *fSections;          // List of section frames
00052    TGCanvas            *fCan;               // sections container
00053    TGeoPcon            *fShape;             // Shape object
00054    Bool_t               fIsModified;        // Flag that volume was modified
00055    Bool_t               fIsShapeEditable;   // Flag that the shape can be changed
00056 
00057    TGLayoutHints       *fLHsect;            // Layout hints for sections
00058    TGTextEntry         *fShapeName;         // Shape name text entry
00059    TGNumberEntry       *fENz;               // Number entry for nsections
00060    TGNumberEntry       *fEPhi1;             // Number entry for phi1
00061    TGNumberEntry       *fEDPhi;             // Number entry for dphi  
00062    TGTextButton        *fApply;             // Apply-Button to accept changes
00063    TGTextButton        *fUndo;              // Undo-Button
00064    TGCompositeFrame    *fBFrame;            // Frame containing Apply/Undo
00065    TGCheckButton       *fDelayed;           // Check button for delayed draw
00066    TGCompositeFrame    *fDFrame;            // Frame containing Delayed draw
00067 
00068    virtual void ConnectSignals2Slots();   // Connect the signals to the slots
00069    Bool_t       CheckSections(Bool_t change=kFALSE);
00070    Bool_t       IsDelayed() const;   
00071    void         CreateSections(Int_t inew);
00072    void         UpdateSections();
00073    virtual void CreateEdges() {;}
00074 public:
00075    TGeoPconEditor(const TGWindow *p = 0,
00076                    Int_t width = 140, Int_t height = 30,
00077                    UInt_t options = kChildFrame,
00078                    Pixel_t back = GetDefaultFrameBackground());
00079    virtual ~TGeoPconEditor();
00080    virtual void   SetModel(TObject *obj);
00081    
00082    void           DoModified();
00083    void           DoName();
00084    void           DoNz();
00085    void           DoPhi();
00086    void           DoSectionChange(Int_t i);
00087    virtual void   DoApply();
00088    virtual void   DoUndo();
00089    
00090    ClassDef(TGeoPconEditor,0)   // TGeoPcon editor
00091 };   
00092   
00093 //////////////////////////////////////////////////////////////////////////
00094 //                                                                      //
00095 //  TGeoPconSection                                                     //
00096 //                                                                      //
00097 //  Utility frame used by TGeoPcon editor.                              //
00098 //                                                                      //
00099 //////////////////////////////////////////////////////////////////////////
00100 
00101 class TGeoPconSection : public TGCompositeFrame, public TGWidget  {
00102 
00103 protected:
00104    Int_t                fNumber;            // Id for the section
00105    TGNumberEntry       *fEZ;                // Number entry for Z position
00106    TGNumberEntry       *fERmin;             // Number entry for Rmin position
00107    TGNumberEntry       *fERmax;             // Number entry for Rmax position
00108 
00109    virtual void    ConnectSignals2Slots();
00110    
00111 public:
00112    TGeoPconSection(const TGWindow *p, UInt_t w, UInt_t h, Int_t id);
00113    virtual ~TGeoPconSection();
00114    void         HideDaughters();
00115    Double_t     GetZ() const;
00116    Double_t     GetRmin() const;
00117    Double_t     GetRmax() const;
00118    void         SetZ(Double_t z);
00119    void         SetRmin(Double_t rmin);
00120    void         SetRmax(Double_t rmax);
00121 
00122    void           DoZ();
00123    void           DoRmin();
00124    void           DoRmax();
00125 
00126    virtual void Changed(Int_t i);   // *SIGNAL*
00127 
00128    ClassDef(TGeoPconSection,0)   // TGeoPcon section
00129 };      
00130 #endif                    

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