Ignore:
Timestamp:
Feb 26, 2013, 2:38:17 PM (11 years ago)
Author:
touze
Message:

nvx element snapshot

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_abstractElementFactory.cc

    r289 r343  
    99#include "GWt_abstractElementFactory.h"
    1010
     11GWt_abstractElementFactory::GWt_abstractElementFactory()
     12 :isDriftElementEnable(false),
     13  isRFGunElementEnable(false),
     14  isCellElementEnable(false),
     15  isBendElementEnable(false),
     16  isSolenoElementEnable(false),
     17  isBeamElementEnable(false),
     18  isFitElementEnable(false),
     19  isSnapshotElementEnable(false)
     20{}
    1121
    12 GWt_abstractElementFactory::GWt_abstractElementFactory()
    13 :isDriftElementEnable(false),
    14 isRFGunElementEnable(false),
    15 isCellElementEnable(false),
    16 isBendElementEnable(false),
    17 isSolenoElementEnable(false),
    18 isBeamElementEnable(false),
    19 isFitElementEnable(false)
     22GWt_abstractElementFactory::~GWt_abstractElementFactory()
    2023{
    21    
     24  isDriftElementEnable = false;
     25  isRFGunElementEnable = false;
     26  isCellElementEnable = false;
     27  isBendElementEnable = false;
     28  isSolenoElementEnable = false;
     29  isBeamElementEnable = false;
     30  isFitElementEnable = false;
     31  isSnapshotElementEnable = false;
    2232}
    2333
    24 
    25 GWt_abstractElementFactory::~GWt_abstractElementFactory() {
    26     isDriftElementEnable = false;
    27     isRFGunElementEnable = false;
    28     isCellElementEnable = false;
    29     isBendElementEnable = false;
    30     isSolenoElementEnable = false;
    31     isBeamElementEnable = false;
    32     isFitElementEnable = false;
     34GWt_drift* GWt_abstractElementFactory::createDriftElement()
     35{
     36  if (isDriftElementEnable) {
     37    return new GWt_drift();
     38  }
     39  return NULL;
    3340}
    3441
    35 
    36 GWt_drift* GWt_abstractElementFactory::createDriftElement() {
    37     if (isDriftElementEnable) {
    38         return new GWt_drift();
    39     }
    40     return NULL;
     42GWt_rfgun* GWt_abstractElementFactory::createRFGunElement()
     43{
     44  if (isRFGunElementEnable) {
     45    return new GWt_rfgun();
     46  }
     47  return NULL;
    4148}
    4249
    43 
    44 GWt_rfgun* GWt_abstractElementFactory::createRFGunElement() {
    45     if (isRFGunElementEnable) {
    46         return new GWt_rfgun();
    47     }
    48     return NULL;
     50GWt_cell* GWt_abstractElementFactory::createCellElement()
     51{
     52  if (isCellElementEnable) {
     53    return new GWt_cell();
     54  }
     55  return NULL;
    4956}
    5057
    51 GWt_cell* GWt_abstractElementFactory::createCellElement() {
    52     if (isCellElementEnable) {
    53         return new GWt_cell();
    54     }
    55     return NULL;
     58GWt_bend* GWt_abstractElementFactory::createBendElement()
     59{
     60  if (isBendElementEnable) {
     61    return new GWt_bend();
     62  }
     63  return NULL;
    5664}
    57 
    58 
    59 GWt_bend* GWt_abstractElementFactory::createBendElement() {
    60     if (isBendElementEnable) {
    61         return new GWt_bend();
    62     }
    63     return NULL;
    64 }
    65 
    6665
    6766GWt_soleno* GWt_abstractElementFactory::createSolenoElement()
    6867{
    69     if (isSolenoElementEnable) {
    70         return new GWt_soleno();
    71     }
    72     return NULL;
     68  if (isSolenoElementEnable) {
     69    return new GWt_soleno();
     70  }
     71  return NULL;
    7372}
    7473
    75 GWt_beam* GWt_abstractElementFactory::createBeamElement() {
    76     if (isBeamElementEnable) {
    77         return new GWt_beam();
    78     }
    79     return NULL;
     74GWt_beam* GWt_abstractElementFactory::createBeamElement()
     75{
     76  if (isBeamElementEnable) {
     77    return new GWt_beam();
     78  }
     79  return NULL;
    8080}
    8181
    82 
    83 GWt_fit* GWt_abstractElementFactory::createFitElement() {
    84     if (isFitElementEnable) {
    85         return new GWt_fit();
    86     }
    87     return NULL;
     82GWt_fit* GWt_abstractElementFactory::createFitElement()
     83{
     84  if (isFitElementEnable) {
     85    return new GWt_fit();
     86  }
     87  return NULL;
    8888}
    8989
    90 vector <GWt_abstractElement*> GWt_abstractElementFactory::getAllElements(){
    91     vector <GWt_abstractElement*> elems;
    92     if (isDriftElementEnable) {
    93         elems.push_back(new GWt_drift());
    94     }
    95     if (isBeamElementEnable) {
    96         elems.push_back(new GWt_beam());
    97     }
    98     if (isBendElementEnable) {
    99         elems.push_back(new GWt_bend());
    100     }
    101     if (isCellElementEnable) {
    102         elems.push_back(new GWt_cell());
    103     }
    104     if (isFitElementEnable) {
    105         elems.push_back(new GWt_fit());
    106     }
    107     if (isRFGunElementEnable) {
    108         elems.push_back(new GWt_rfgun());
    109     }
    110     if (isSolenoElementEnable) {
    111         elems.push_back(new GWt_soleno());
    112     }
    113     return elems;
     90GWt_snapshot* GWt_abstractElementFactory::createSnapshotElement()
     91{
     92  if (isSnapshotElementEnable) {
     93    return new GWt_snapshot();
     94  }
     95  return NULL;
    11496}
     97
     98vector <GWt_abstractElement*> GWt_abstractElementFactory::getAllElements()
     99{
     100  vector <GWt_abstractElement*> elems;
     101  if (isDriftElementEnable) {
     102    elems.push_back(new GWt_drift());
     103  }
     104  if (isBeamElementEnable) {
     105    elems.push_back(new GWt_beam());
     106  }
     107  if (isBendElementEnable) {
     108    elems.push_back(new GWt_bend());
     109  }
     110  if (isCellElementEnable) {
     111    elems.push_back(new GWt_cell());
     112  }
     113  if (isFitElementEnable) {
     114    elems.push_back(new GWt_fit());
     115  }
     116  if (isRFGunElementEnable) {
     117    elems.push_back(new GWt_rfgun());
     118  }
     119  if (isSolenoElementEnable) {
     120    elems.push_back(new GWt_soleno());
     121  }
     122  if (isSnapshotElementEnable) {
     123    elems.push_back(new GWt_snapshot());
     124  }
     125
     126  return elems;
     127}
Note: See TracChangeset for help on using the changeset viewer.