ROOT logo
// @(#):$Id: TGeoPconEditor.h 21425 2007-12-17 15:59:27Z brun $
// Author: M.Gheata 
/*************************************************************************
 * Copyright (C) 1995-2002, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TGeoPconEditor
#define ROOT_TGeoPconEditor

//////////////////////////////////////////////////////////////////////////
//                                                                      //
//  TGeoPconEditor                                                      //
//                                                                      //
//  Editor for a TGeoPcon.                                              //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TGButton
#include "TGWidget.h"
#endif
#ifndef ROOT_TGeoGedFrame
#include "TGeoGedFrame.h"
#endif

class TGeoPcon;
class TGeoPconSection;
class TGeoTabManager;
class TGTextEntry;
class TGNumberEntry;
class TGTab;
class TGComboBox;
class TGTextButton;
class TGCheckButton;
class TGCanvas;
class TString;

class TGeoPconEditor : public TGeoGedFrame {

protected:
   Int_t                fNsecti;            // Initial number of sections
   Double_t             fPhi1i;             // Initial Phi1
   Double_t             fDPhii;             // Initial Dphi
   Double_t            *fZi;                // Initial Z positions
   Double_t            *fRmini;             // Initial Rmin values
   Double_t            *fRmaxi;             // Initial Rmax values   
   Int_t                fNsections;         // Number of Z sections
   TObjArray           *fSections;          // List of section frames
   TGCanvas            *fCan;               // sections container
   TGeoPcon            *fShape;             // Shape object
   Bool_t               fIsModified;        // Flag that volume was modified
   Bool_t               fIsShapeEditable;   // Flag that the shape can be changed

   TGLayoutHints       *fLHsect;            // Layout hints for sections
   TGTextEntry         *fShapeName;         // Shape name text entry
   TGNumberEntry       *fENz;               // Number entry for nsections
   TGNumberEntry       *fEPhi1;             // Number entry for phi1
   TGNumberEntry       *fEDPhi;             // Number entry for dphi  
   TGTextButton        *fApply;             // Apply-Button to accept changes
   TGTextButton        *fUndo;              // Undo-Button
   TGCompositeFrame    *fBFrame;            // Frame containing Apply/Undo
   TGCheckButton       *fDelayed;           // Check button for delayed draw
   TGCompositeFrame    *fDFrame;            // Frame containing Delayed draw

   virtual void ConnectSignals2Slots();   // Connect the signals to the slots
   Bool_t       CheckSections(Bool_t change=kFALSE);
   Bool_t       IsDelayed() const;   
   void         CreateSections(Int_t inew);
   void         UpdateSections();
   virtual void CreateEdges() {;}
public:
   TGeoPconEditor(const TGWindow *p = 0,
                   Int_t width = 140, Int_t height = 30,
                   UInt_t options = kChildFrame,
                   Pixel_t back = GetDefaultFrameBackground());
   virtual ~TGeoPconEditor();
   virtual void   SetModel(TObject *obj);
   
   void           DoModified();
   void           DoName();
   void           DoNz();
   void           DoPhi();
   void           DoSectionChange(Int_t i);
   virtual void   DoApply();
   virtual void   DoUndo();
   
   ClassDef(TGeoPconEditor,0)   // TGeoPcon editor
};   
  
//////////////////////////////////////////////////////////////////////////
//                                                                      //
//  TGeoPconSection                                                     //
//                                                                      //
//  Utility frame used by TGeoPcon editor.                              //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

class TGeoPconSection : public TGCompositeFrame, public TGWidget  {

protected:
   Int_t                fNumber;            // Id for the section
   TGNumberEntry       *fEZ;                // Number entry for Z position
   TGNumberEntry       *fERmin;             // Number entry for Rmin position
   TGNumberEntry       *fERmax;             // Number entry for Rmax position

   virtual void    ConnectSignals2Slots();
   
public:
   TGeoPconSection(const TGWindow *p, UInt_t w, UInt_t h, Int_t id);
   virtual ~TGeoPconSection();
   void         HideDaughters();
   Double_t     GetZ() const;
   Double_t     GetRmin() const;
   Double_t     GetRmax() const;
   void         SetZ(Double_t z);
   void         SetRmin(Double_t rmin);
   void         SetRmax(Double_t rmax);

   void           DoZ();
   void           DoRmin();
   void           DoRmax();

   virtual void Changed(Int_t i);   // *SIGNAL*

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