source: trunk/source/intercoms/include/G4UIcommandTree.hh@ 827

Last change on this file since 827 was 821, checked in by garnier, 17 years ago

import all except CVS

File size: 3.7 KB
RevLine 
[821]1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26//
27// $Id: G4UIcommandTree.hh,v 1.15 2006/06/29 19:08:11 gunter Exp $
28// GEANT4 tag $Name: geant4-09-01-patch-02 $
29//
30
31#ifndef G4UIcommandTree_h
32#define G4UIcommandTree_h 1
33
34
35#include "G4UIcommand.hh"
36#include "globals.hh"
37#include <vector>
38
39// class description:
40//
41// This class is exclusively used by G4UImanager for handling the
42// tree structure of the commands. The user MUST NOT construct/use
43// this class object.
44
45class G4UIcommandTree
46{
47 public:
48 G4UIcommandTree();
49 G4UIcommandTree(const char * thePathName);
50 ~G4UIcommandTree();
51 G4int operator==(const G4UIcommandTree &right) const;
52 G4int operator!=(const G4UIcommandTree &right) const;
53
54 public:
55 void AddNewCommand(G4UIcommand * newCommand);
56 void RemoveCommand(G4UIcommand * aCommand);
57 G4UIcommand * FindPath(const char* commandPath);
58 void List();
59 void ListCurrent();
60 void ListCurrentWithNum();
61 void CreateHTML();
62
63 private:
64 G4String CreateFileName(const char* pName);
65 G4String ModStr(const char* strS);
66
67 std::vector<G4UIcommand*> command;
68 std::vector<G4UIcommandTree*> tree;
69 G4UIcommand *guidance;
70 G4String pathName;
71
72 public:
73 inline const G4UIcommand * GetGuidance() const
74 { return guidance; };
75 inline const G4String GetPathName() const
76 { return pathName; };
77 inline G4int GetTreeEntry() const
78 { return tree.size(); };
79 inline G4int GetCommandEntry() const
80 { return command.size(); };
81 inline G4UIcommandTree * GetTree(G4int i)
82 { return tree[i-1]; };
83 inline G4UIcommandTree * GetTree(const char* comNameC)
84 {
85 G4String comName = comNameC;
86 for( size_t i=0; i < tree.size(); i++)
87 {
88 if( comName == tree[i]->GetPathName() )
89 { return tree[i]; }
90 }
91 return NULL;
92 };
93 inline G4UIcommand * GetCommand(G4int i)
94 { return command[i-1]; };
95 inline const G4String GetTitle() const
96 {
97 if(guidance==NULL)
98 { return G4String("...Title not available..."); }
99 else
100 { return guidance->GetTitle(); }
101 };
102
103};
104
105#endif
106
Note: See TracBrowser for help on using the repository browser.