[Bio] / RecoElemSBW / SBMLtoRecoElem.cc Repository:
ViewVC logotype

View of /RecoElemSBW/SBMLtoRecoElem.cc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (download) (as text) (annotate)
Thu Sep 18 21:18:40 2003 UTC (16 years, 2 months ago) by efrank
Branch: MAIN
Changes since 1.4: +3 -3 lines
Move all of SbmlFactory into SbwFactory and migrate SBMLtoRecoElem to
match.

SBMLtoRecoElem.cc:
   makes an SbwFactory rather than SbmlFactory and then uses it

SbmlFactory.cc, SbmlFactory.hh:
   ???

SbwFactory.{cc,hh}
   Now has guts fo SbmlFactory plus skeleton for writeToSbmlFile(char* filename)

#include <stdio.h>
#include <string>

#include "RecoReadout/RecoElem.hh"
#include "RecoReadout/Reaction.hh"
#include "MExplorer/xduGen.hh"

#include "RecoElemSBW/SbwFactory.hh"



using namespace std;

//************************************************************************
void printList (RecoElem& elem);
//************************************************************************




//************************************************************************
int
main(int argc, char* argv[] ) {
//************************************************************************
  SbwFactory  sbwFactory;
 
  if (argc != 2) {
    printf("usage: readSBML <filename>\n");
    return 1;
  }


  RecoElem* elem = sbwFactory.getRecoElemFromSbmlFile( argv[1] );

  cout << "************************" << endl;
  printList(*elem);
  cout << "************************" << endl;

  std::string path="";
  xduGen( *elem, path );

  return 0;
}




//************************************************************************
void printList (RecoElem& elem)
//************************************************************************
{

  // I don't think there's any subelements. Model w/ one subelement, and 1 kid

  vector<RecoElem>& subElem   = elem.getSubElements();
  vector<Reaction>& rxns      = elem.getReactions();

  int nrxns= rxns.size ();
  int nkids= subElem.size ();

  cout << "MY NAME: " << elem.getName() << endl;
  cout << "  No. of reactions " << nrxns << endl;
  cout << "  No. of kids: " << nkids << endl;


  for (int l=0; l< nrxns ; l++) {
    cout << rxns[l].asString( ) << endl; 
  }


  for (int i=0; i<nkids; i++){
    cout << "in deeper  ****  " << endl;
    printList(subElem[i]);
    cout << "back up *** " << endl;
  }

  return;
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3