head	1.6;
access;
symbols
	GEOMVIEW_1_9_4_RELEASE:1.5
	GEOMVIEW_1_9_2_RELEASE:1.5
	GEOMVIEW_1_9_3_RELEASE:1.5
	GEOMVIEW_1_9_1_RELEASE:1.5
	GEOMVIEW_1_9_1:1.5
	GEOMVIEW_1_9_0_RELEASE:1.5
	GEOMVIEW_PRE_NDVIEW_CHANGE:1.2;
locks; strict;
comment	@# @;


1.6
date	2014.03.12.16.35.31;	author rotdrop;	state dead;
branches;
next	1.5;

1.5
date	2007.02.15.17.10.14;	author rotdrop;	state Exp;
branches;
next	1.4;

1.4
date	2006.10.29.21.49.18;	author rotdrop;	state Exp;
branches;
next	1.3;

1.3
date	2006.10.26.22.54.57;	author rotdrop;	state Exp;
branches;
next	1.2;

1.2
date	2006.07.29.17.28.25;	author rotdrop;	state Exp;
branches;
next	1.1;

1.1
date	2006.07.28.18.09.08;	author rotdrop;	state Exp;
branches;
next	;


desc
@@


1.6
log
@Maintenance commit, make it compile.
@
text
@if [catch {set ndroot $env(NDVIEWROOT)}] {
    if [catch {set ndroot $env(GEOMDATA)/NDview}] {
	puts stderr "Normally, modules are run in an environment in which the GEOMDATA environment\nvariable is set, which has not been done.  This is done by the geomview\nshell script:  please check your shell script.\n"
	exit 1
    }
} else {
    puts "(set-load-path ($ndroot +))"
    set ndroot "${ndroot}/NDview"
}

proc mkDemo {} {
    wm geometry . +0+0

    frame .o
    label .o.objectlabel -text "Objects"
    frame .o.f -relief raised -bd 3
    listbox .o.f.objects -selectmode browse -width 11 -height 9
    bind .o.f.objects <ButtonRelease-1> {loadit [selection get]}
    .o.f.objects insert end "Point"
    .o.f.objects insert end "2 Points"
    .o.f.objects insert end "Segment"
    .o.f.objects insert end "2 Segments"
    .o.f.objects insert end "Square"
    .o.f.objects insert end "2 Squares"
    .o.f.objects insert end "Cube"
    .o.f.objects insert end "2 Cubes"
    .o.f.objects insert end "Tesseract"

    .o.f.objects select set 0
    pack .o.f.objects -expand 1 -fill y
    pack .o.objectlabel
    pack .o.f -expand 1 -fill y
    pack .o -side left -padx 2 -pady 2 -fill y

    frame .text
    pack .text -side left -padx 2 -pady 2 -expand 1 -fill both
    text .text.t -relief sunken -bd 3 -width 50 -height 1 -yscrollcommand ".text.s set"
    scrollbar .text.s -command ".text.t yview"
    pack .text.s -fill y -side right
    pack .text.t -expand 1 -fill both

    frame .right
    button .right.quit -command {
	catch {
	    puts {
		(if (real-id axes) (delete axes))
		(if (real-id g2) (delete g2))
		(if (real-id X_W_plane) (delete X_W_plane))
		(if (real-id X_Y_Z_hyperplane) (delete X_Y_Z_hyperplane))
	    }
	    flush stdout
	}
	catch {exec "killall eitherwindow"}
	exit
    } -text "Quit"
    button .right.reset -command {
	puts "(load NDview/scripts/reset.script command)"
	flush stdout
	.right.mslider.slider set 0
    } -text "Reset"
    button .right.help -command "loadtext text/demohelp.txt" -text "Help"
    label .right.motion -text "Motion"

    frame .right.mslider
    frame .right.mslider.labels
    label .right.mslider.labels.fast -text "Fast"
    label .right.mslider.labels.slow -text "Slow"
    label .right.mslider.labels.stop -text "Stop"
    pack .right.mslider.labels.fast -side top
    pack .right.mslider.labels.stop .right.mslider.labels.slow -side bottom
    pack .right.mslider.labels -side left -expand 1 -fill y
    scale .right.mslider.slider -showvalue no -from 1 -to 0 -resolution 0.01 \
	-command "setspeed"
    pack .right.mslider.slider -side right -expand 1 -fill y
    
    pack .right.quit .right.reset .right.help .right.motion -fill x
    pack .right.mslider -expand 1 -fill y
    
    pack .right -side right -fill y -padx 2 -pady 2

    wm resizable . 0 0
}

######################################################################

proc setspeed {val} {
    if 0==$val {
	puts "(transform g2 X_W_plane X_W_plane rotate 0 0 0)"
    } else {
	puts [format "(transform-incr g2 X_W_plane X_W_plane rotate 0 0 1.57 %f)" [expr .5/($val*$val)]]
    }
    flush stdout
}

proc loadit {which} {
    switch -exact $which {
	"Point" {set data {text/point.txt NDview/geom/demo/point}}
	"2 Points" {set data {text/pointd.txt NDview/geom/demo/points}}
	"Segment" {set data {text/segment.txt NDview/geom/demo/segmentw+x+z+}}
	"2 Segments" {set data {text/segmentd.txt NDview/geom/demo/segmentw+x+z}}
	"Square" {set data {text/square.txt NDview/geom/demo/squarew+x+}}
	"2 Squares" {set data {text/squared.txt NDview/geom/demo/squarew+x}}
	"Cube" {set data {text/cube.txt NDview/geom/demo/cubew+}}
	"2 Cubes" {set data {text/cubed.txt NDview/geom/demo/cubew}}
	"Tesseract" {set data {text/tesseract.txt NDview/geom/demo/tesseract}}
    }
    loadtext [lindex $data 0]
    puts "(if (real-id g2) (progn (geometry g2 < [lindex $data 1])) (load [lindex $data 1]))"
    flush stdout
}

proc loadtext {text} {
    global ndroot
    set f [open $ndroot/$text]
    .text.t configure -state normal
    .text.t delete 0.0 end
    .text.t insert end [read $f]
    .text.t configure -state disabled
    close $f
}


mkDemo
puts [format {
    (load NDview/scripts/startup.big.script command)
    (load NDview/scripts/reset.script command)
    (emodule-run %s/scripts/eitherwindow)
} $ndroot]
loadit Point
loadtext text/demohelp.txt
flush stdout
@


1.5
log
@Remove invalid script interpreter
@
text
@@


1.4
log
@The "origin/bbox-center" keyword to transform and transform-incr was a
bad idea. There is still a new button in the Tools-menu which
translates the CENTER object to the currently selected geom's bounding box.
@
text
@a0 2
#!./testwish

@


1.3
log
@Fixed a BUNCH of memory leaks and other errors. But the main-work was
to move thehomogeneous component to index 0. And the most important
change was that each camera of an ND-cluster now has additionally its
own 3d transform.
@
text
@d92 1
a92 1
	puts [format "(transform-incr g2 X_W_plane X_W_plane rotate 0 0 1.57 origin %f)" [expr .5/($val*$val)]]
@


1.2
log
@Enable in-build-tree use of NDview and NDdemo.
@
text
@d92 1
a92 1
	puts [format "(transform-incr g2 X_W_plane X_W_plane rotate 0 0 1.57 %f)" [expr .5/($val*$val)]]
@


1.1
log
@Forthcoming NDview module, but needs more work.
@
text
@d3 8
a10 3
if [catch {set ndroot $env(GEOMDATA)}] {
    puts stderr "Normally, modules are run in an environment in which the GEOMDATA environment\nvariable is set, which has not been done.  This is done by the geomview\nshell script:  please check your shell script.\n"
    exit 1
d116 1
a116 1
    set f [open $ndroot/NDview/$text]
d130 1
a130 1
} $ndroot/NDview]
@

