From 480661cfdd4e38d57277e462154f6f244b157dca Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Sun, 3 Feb 2013 14:44:27 +0000 Subject: [PATCH] second clipping plane --- ng/dialog.tcl | 9 ++++++++- ng/ngpkg.cpp | 7 +++---- ng/variables.tcl | 1 + 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ng/dialog.tcl b/ng/dialog.tcl index 093d5760..9ecfdea0 100644 --- a/ng/dialog.tcl +++ b/ng/dialog.tcl @@ -1163,6 +1163,13 @@ proc clippingdialog { } { -variable viewoptions.clipping.dist \ -command { clipplanecommand } # -command { popupcheckredraw2 clippingdialog_pop4 ${viewoptions.clipping.enable} } + + label $w.lab5 -text "Additional Distance" + scale $w.scale5 -orient horizontal -length 300 -from -1 -to 1.001 \ + -resolution 0.0001 -tickinterval 0.5 \ + -variable viewoptions.clipping.dist2 \ + -command { clipplanecommand } + tixControl $w.clipdomain -label "Clip only domain" -integer true \ @@ -1176,7 +1183,7 @@ proc clippingdialog { } { -command { clipplanecommand; } # -command { Ng_SetVisParameters; redraw } - pack $w.lab1 $w.scale1 $w.lab2 $w.scale2 $w.lab3 $w.scale3 $w.lab4 $w.scale4 $w.clipdomain $w.donotclipdomain + pack $w.lab1 $w.scale1 $w.lab2 $w.scale2 $w.lab3 $w.scale3 $w.lab4 $w.scale4 $w.lab5 $w.scale5 $w.clipdomain $w.donotclipdomain checkbutton $w.cb1 -text "Enable clipping" \ diff --git a/ng/ngpkg.cpp b/ng/ngpkg.cpp index b094a063..baaa0dd6 100644 --- a/ng/ngpkg.cpp +++ b/ng/ngpkg.cpp @@ -2865,6 +2865,7 @@ void PlayAnimFile(const char* name, int speed, int maxcnt) hclip.normal.Y() = atof (Tcl_GetVar (interp, "::viewoptions.clipping.ny", TCL_GLOBAL_ONLY)); hclip.normal.Z() = atof (Tcl_GetVar (interp, "::viewoptions.clipping.nz", TCL_GLOBAL_ONLY)); hclip.dist = atof (Tcl_GetVar (interp, "::viewoptions.clipping.dist", TCL_GLOBAL_ONLY)); + hclip.dist2 = atof (Tcl_GetVar (interp, "::viewoptions.clipping.dist2", TCL_GLOBAL_ONLY)); hclip.enable = atoi (Tcl_GetVar (interp, "::viewoptions.clipping.enable", TCL_GLOBAL_ONLY)); vispar.clipdomain = atoi (Tcl_GetVar (interp, "::viewoptions.clipping.onlydomain", TCL_GLOBAL_ONLY)); @@ -2872,10 +2873,8 @@ void PlayAnimFile(const char* name, int speed, int maxcnt) atoi (Tcl_GetVar (interp, "::viewoptions.clipping.notdomain", TCL_GLOBAL_ONLY)); if ( ! (hclip == vispar.clipping) ) - { - hclip.timestamp = NextTimeStamp(); - vispar.clipping = hclip; - } + hclip.timestamp = NextTimeStamp(); + vispar.clipping = hclip; vispar.whitebackground = atoi (Tcl_GetVar (interp, "::viewoptions.whitebackground", TCL_GLOBAL_ONLY)); diff --git a/ng/variables.tcl b/ng/variables.tcl index c9ee8c0b..300b91a8 100644 --- a/ng/variables.tcl +++ b/ng/variables.tcl @@ -124,6 +124,7 @@ set viewoptions.clipping.nx 0 set viewoptions.clipping.ny 1 set viewoptions.clipping.nz 0 set viewoptions.clipping.dist 0 +set viewoptions.clipping.dist2 0 set viewoptions.clipping.enable 0 set viewoptions.clipping.onlydomain 0 set viewoptions.clipping.notdomain 0