source: PSPA/Interface_Web/trunk/pspaWT/include/nomdElements.h @ 225

Last change on this file since 225 was 225, checked in by lemeur, 12 years ago

element 'fit' + label en parametre

File size: 1.4 KB
Line 
1#ifndef NOMDELEMENTS_SEEN
2#define NOMDELEMENTS_SEEN
3
4using namespace std;
5
6enum typedElement {beam, RFgun, drift, cell, bend, soleno, fit, inconnu};
7
8
9
10class nomdElements
11{
12  typedElement e_;  // type entier (enum)
13  std::string eName_;  // nom de l'element
14  std::string eImg_;  // nom du fichier de l'icone
15  std::string eLabel_; // label affiche sous l'icone
16  unsigned nbParam_;   // nombre de parametres a saisir
17
18  static   typedElement fromImage(std::string s);
19  static   typedElement fromLabel(std::string s);
20  static   std::string toName(typedElement eType);
21  static   std::string toImage(typedElement eType);
22  static   std::string toLabel(typedElement eType);
23  static   unsigned toNbParam(typedElement eType);
24
25 public :
26 
27  nomdElements();
28  nomdElements(nomdElements& ne);
29  nomdElements(const nomdElements& ne);
30  nomdElements(const std::string& s);
31  nomdElements(typedElement& eType); 
32
33
34  static int getNumberOfElements();
35  static string getImageFromType( typedElement tp);
36  static std::string getLabelFromType(typedElement tp);
37  static typedElement getTypeFromLabel(std::string lb);
38
39  typedElement getElementType() const;
40  std::string getElementName() const;
41  std::string getElementLabel() const;
42  std::string getElementImage() const;
43  unsigned getElementNbParameters() const;
44
45  // operators
46 
47  nomdElements& operator= (const nomdElements& ne);
48
49
50};
51#endif
Note: See TracBrowser for help on using the repository browser.