diff --git a/Box/Box.cpp b/Box/Box.cpp index 4c6789f10d5b7e80ffae02284789f34e3a747f92..24265bf67cf10fc395c6734d48e073e2d1dd3822 100644 --- a/Box/Box.cpp +++ b/Box/Box.cpp @@ -1,4 +1,4 @@ -// $Id: Box.cpp,v 1.46 2008-03-18 11:33:04 remacle Exp $ +// $Id: Box.cpp,v 1.47 2008-03-18 11:41:08 remacle Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -88,7 +88,7 @@ int GMSHBOX(int argc, char *argv[]) if(CTX.bgm_filename) { MergeFile(CTX.bgm_filename); if(PView::list.size()){ - GModel::current()->fields.set_background_mesh(PView::list.back()->getNum()); + GModel::current()->fields.set_background_mesh(PView::list.back()->getNum()-1); } else{ fprintf(stderr, ERROR_STR "Invalid background mesh (no view)\n"); diff --git a/Fltk/Main.cpp b/Fltk/Main.cpp index df3138cc2ffe62f60ba46e2bdff59d50a7a57549..e7682654cb5d704c877a1d64d6952418b079656b 100644 --- a/Fltk/Main.cpp +++ b/Fltk/Main.cpp @@ -1,4 +1,4 @@ -// $Id: Main.cpp,v 1.122 2008-03-18 11:33:04 remacle Exp $ +// $Id: Main.cpp,v 1.123 2008-03-18 11:41:08 remacle Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -88,8 +88,7 @@ int main(int argc, char *argv[]) if(CTX.bgm_filename) { MergeFile(CTX.bgm_filename); if(PView::list.size()){ - printf("iii = %i\n",PView::list.back()->getNum()); - GModel::current()->fields.set_background_mesh(PView::list.back()->getNum()); + GModel::current()->fields.set_background_mesh(PView::list.back()->getNum()-1); } else Msg(GERROR, "Invalid background mesh (no view)"); @@ -169,7 +168,7 @@ int main(int argc, char *argv[]) if(CTX.bgm_filename) { MergeFile(CTX.bgm_filename); if(PView::list.size()) - GModel::current()->fields.set_background_mesh(PView::list.back()->getNum()); + GModel::current()->fields.set_background_mesh(PView::list.back()->getNum()-1); else Msg(GERROR, "Invalid background mesh (no view)"); } diff --git a/Mesh/Field.cpp b/Mesh/Field.cpp index cb83af0d0467273e6585dae47cb081ea67a40a79..1c2ac8f6d047ea034d9abc4186e89ed790a6b54b 100644 --- a/Mesh/Field.cpp +++ b/Mesh/Field.cpp @@ -1,4 +1,4 @@ -// $Id: Field.cpp,v 1.17 2008-03-18 11:33:04 remacle Exp $ +// $Id: Field.cpp,v 1.18 2008-03-18 11:41:08 remacle Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -892,7 +892,7 @@ void Field::put_on_view(PView *view,int comp) void FieldManager::set_background_mesh(int iView){ int id=new_id(); Field *f=new_field(id,"PostView"); - f->options["IView"]->numerical_value(iView-1); + f->options["IView"]->numerical_value(iView); (*this)[id]=f; background_field=id; }