if(saveId==-1) saveId=gScattererRegistry.GetObj(0).CreateParamSet(); else gScattererRegistry.GetObj(0).SaveParamSet(saveId); gScattererRegistry.GetObj(0).GlobalOptRandomMove(1); gCrystalRegistry.GetObj(0).UpdateDisplay(); if(saveId2==-1) saveId2=gScattererRegistry.GetObj(0).CreateParamSet(); else gScattererRegistry.GetObj(0).SaveParamSet(saveId2);
open= new wxFileDialog(this,"Choose File :", "","","*.xml",wxOPEN | wxFILE_MUST_EXIST); if(open->ShowModal() != wxID_OK) return; XMLCrystFileLoadAllObject(open->GetPath().c_str());
void WXCrystMainFrame::OnDebugTest(wxCommandEvent& event){   WXCrystValidateAllUserInput();   static long saveId=-1;   static long saveId2=-1;   if(event.GetId()== MENU_DEBUG_TEST1)   {      if(saveId==-1) saveId=gScattererRegistry.GetObj(0).CreateParamSet();      else gScattererRegistry.GetObj(0).SaveParamSet(saveId);      gScattererRegistry.GetObj(0).GlobalOptRandomMove(1);      gCrystalRegistry.GetObj(0).UpdateDisplay();      if(saveId2==-1) saveId2=gScattererRegistry.GetObj(0).CreateParamSet();      else gScattererRegistry.GetObj(0).SaveParamSet(saveId2);   }   if(event.GetId()== MENU_DEBUG_TEST2)   {      gScattererRegistry.GetObj(0).RestoreParamSet(saveId);      gCrystalRegistry.GetObj(0).UpdateDisplay();   }   if(event.GetId()== MENU_DEBUG_TEST3)   {      Crystal *cryst=new Crystal(25.,30.,35.,"P1");      ScatteringPowerAtom *ScattPowS=new ScatteringPowerAtom("S" ,"S",0.74);      ScatteringPowerAtom *ScattPowO=new ScatteringPowerAtom("O","O",1.87);      cryst->AddScatteringPower(ScattPowS);      cryst->AddScatteringPower(ScattPowO);      Molecule *mol;      mol=MakeTetrahedron(*cryst,"SO4",ScattPowS,ScattPowO,1.5);      mol->RestraintStatus(cout);cryst->AddScatterer(mol);            mol=MakeOctahedron(*cryst,"SO6",ScattPowS,ScattPowO,1.5);      mol->RestraintStatus(cout);cryst->AddScatterer(mol);            mol=MakeSquarePlane(*cryst,"SO6",ScattPowS,ScattPowO,1.5);      mol->RestraintStatus(cout);cryst->AddScatterer(mol);            mol=MakeCube(*cryst,"SO8",ScattPowS,ScattPowO,1.5);      mol->RestraintStatus(cout);cryst->AddScatterer(mol);            mol=MakePrismTrigonal(*cryst,"SO6",ScattPowS,ScattPowO,1.5);      mol->RestraintStatus(cout);cryst->AddScatterer(mol);            mol=MakeIcosahedron(*cryst,"SO12",ScattPowS,ScattPowO,1.5);      mol->RestraintStatus(cout);cryst->AddScatterer(mol);            mol=MakeTriangle(*cryst,"SO3",ScattPowS,ScattPowO,1.5);      mol->RestraintStatus(cout);cryst->AddScatterer(mol);            mol=MakeAntiPrismTetragonal(*cryst,"SO8",ScattPowS,ScattPowO,1.5);      mol->RestraintStatus(cout);cryst->AddScatterer(mol);      cryst->RandomizeConfiguration();      WXCrystal *pWXCryst=dynamic_cast<WXCrystal*> (gCrystalRegistry.GetObj(0).WXGet());      wxCommandEvent com;      pWXCryst->OnMenuCrystalGL(com);   }}