From 99ad65f885d646be02401ce0db1eed195acd2827 Mon Sep 17 00:00:00 2001 From: Philippose Rajan Date: Wed, 22 Jul 2009 23:00:46 +0000 Subject: [PATCH] * Optimisation of the face colour user interface * Trivial change inside menu option "Special" --- ng/menustat.tcl | 9 +++++++-- ng/ngpkg.cpp | 16 +++++++++++++++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/ng/menustat.tcl b/ng/menustat.tcl index 8e570851..228564f6 100644 --- a/ng/menustat.tcl +++ b/ng/menustat.tcl @@ -777,8 +777,13 @@ menu .ngmenu.special } .ngmenu.special add command -label "Helmholtz Mesh grading" \ -command { Ng_HelmholtzMesh; } -.ngmenu.special add command -label "Colour-based boundary conditions" \ - -command { Ng_AutoColourBcProps; redraw } +.ngmenu.special add cascade -label "Colour-based boundary conditions" -menu .ngmenu.special.colbndcond + +menu .ngmenu.special.colbndcond + .ngmenu.special.colbndcond add command -label "Automatic Assignment" \ + -command { Ng_AutoColourBcProps auto; redraw } + .ngmenu.special.colbndcond add command -label "Profile based Assignment" \ + -command { Ng_AutoColourBcProps profile netgen.ocf; redraw } # menu .mbar.stl.menu diff --git a/ng/ngpkg.cpp b/ng/ngpkg.cpp index 08ee013a..b4311c4f 100644 --- a/ng/ngpkg.cpp +++ b/ng/ngpkg.cpp @@ -1571,13 +1571,27 @@ namespace netgen Tcl_Interp * interp, int argc, tcl_const char *argv[]) { + if(argc < 1) + { + Tcl_SetResult (interp, (char *)"Ng_AutoColourBcProps needs arguments", TCL_STATIC); + return TCL_ERROR; + } + if(!mesh.Ptr()) { Tcl_SetResult (interp, (char *)"Ng_AutoColourBcProps: Valid netgen mesh required...please mesh the Geometry first", TCL_STATIC); return TCL_ERROR; } - AutoColourBcProps(*mesh, "netgen.ocf"); + if(strcmp(argv[1], "auto") == 0) + { + AutoColourBcProps(*mesh, 0); + } + + if(strcmp(argv[1], "profile") == 0) + { + AutoColourBcProps(*mesh, argv[2]); + } return TCL_OK; }