#include "TModel.h" #include "TBitmap.h" TCanvas* c1=0; TF2* img=0; TModel* thismodel=0; Double_t modelfunc(Double_t *var, Double_t *par) { return (*thismodel)(var[0],var[1]); } TModel* genTModel(Option_t* option=0) { TModel* model = new TModel(); model->Randomize(); model->Print(); if (c1) { delete c1; } c1 = new TCanvas("c1","graph window",200,10,700,500); thismodel = model; if (img) { delete img; } img = new TF2("img",modelfunc,-1,1,-1,1,0); Option_t default_option[] = "surf1"; if (option == 0) { option = default_option; } img->Draw(option); c1->Update(); return model; } Int_t drawTModel(TModel* model, Option_t* option=0) { if (c1) { delete c1; } c1 = new TCanvas("c1","graph window",200,10,700,500); c1->Update(); model->Print(); Option_t default_option[] = "surf1"; if (option == 0) { option = default_option; } thismodel = model; if (img) { delete img; } img = new TF2("img",modelfunc,-1,1,-1,1,0); img->Draw(option); return 0; }