Ignore:
Timestamp:
Apr 17, 2009, 10:58:56 AM (15 years ago)
Author:
garnier
Message:

fichiers manquants

Location:
trunk/source/persistency/gdml/src
Files:
17 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/persistency/gdml/src/G4GDMLEvaluator.cc

    r850 r987  
    2525//
    2626//
    27 // $Id: G4GDMLEvaluator.cc,v 1.20 2008/07/16 15:46:34 gcosmo Exp $
     27// $Id: G4GDMLEvaluator.cc,v 1.22 2009/02/26 10:13:35 gcosmo Exp $
    2828// GEANT4 tag $ Name:$
    2929//
     
    144144G4String G4GDMLEvaluator::SolveBrackets(const G4String& in)
    145145{
    146    const std::string::size_type open = in.find("[",0);
    147    const std::string::size_type close = in.find("]",0);
     146   std::string::size_type full  = in.size();
     147   std::string::size_type open  = in.find("[",0);
     148   std::string::size_type close = in.find("]",0);
    148149
    149150   if (open==close) { return in; }
     
    158159   std::string::size_type begin = open;
    159160   std::string::size_type end = 0;
    160 
     161   std::string::size_type end1 = 0;
    161162   std::string out;
    162163   out.append(in,0,open);
     164
     165   do  // Loop for all possible matrix elements in 'in'
     166   {
     167     do   // SolveBrackets for one matrix element
     168     {
     169       end = in.find(",",begin+1);
     170       end1= in.find("]",begin+1);
     171       if (end>end1)                { end = end1; }
     172       if (end==std::string::npos)  { end = close;}
     173     
     174       std::stringstream indexStream;
     175       indexStream << "_" << EvaluateInteger(in.substr(begin+1,end-begin-1))-1;
     176
     177       out.append(indexStream.str());
     178
     179       begin = end;
     180
     181     } while (end<close);
     182   
     183     if (full==close) { return out; }
     184   
     185     open  = in.find("[",begin);
     186     close = in.find("]",begin+1);
     187
     188     if (open==close) { out.append(in.substr(end+1,full-end-1)); return out; }
     189     out.append(in.substr(end+1,open-end-1));
     190
     191     begin=open;
     192   
     193   } while (close<full);
    163194   
    164    do
    165    {
    166       end = in.find(",",begin+1);
    167       if (end==std::string::npos)  { end = close; }
    168 
    169       std::stringstream indexStream;
    170       indexStream << "_" << EvaluateInteger(in.substr(begin+1,end-begin-1));
    171 
    172       out.append(indexStream.str());
    173 
    174       begin = end;
    175 
    176    } while (end<close);
    177 
    178195   return out;
    179196}
Note: See TracChangeset for help on using the changeset viewer.