$Application ExitOnReturnOn

set pv(vtkTemp1) [$Application GetMainWindow]
set pv(vtkTemp43) [$pv(vtkTemp1) GetMainView]

if {[info exists argc]} { 
    set argcm1 [expr $argc - 1]
    for {set i 0} {$i < $argcm1} {incr i} {
        if {[lindex $argv $i] == "-D" && $i < $argcm1} {
		set DataDir [lindex $argv [expr $i + 1]]
        }
        if {[lindex $argv $i] == "-UC" && $i < $argcm1} {
            set rmui [$pv(vtkTemp43) GetRenderModuleUI]
            catch {$rmui SetCompositeThreshold 0}
        }
    }
} 

    
$pv(vtkTemp43) SetBackgroundColor 0 0 0
set pv(vtkTemp89) [$pv(vtkTemp1) GetPVSource GlyphSources Arrow0]
set pv(vtkTemp93) [$pv(vtkTemp1) GetPVSource GlyphSources Cone0]
set pv(vtkTemp97) [$pv(vtkTemp1) GetPVSource GlyphSources Sphere0]

set pv(vtkTemp98) [$pv(vtkTemp1) CreatePVSource SphereSource]
$pv(vtkTemp98) AcceptCallback

set pv(vtkTemp183) [$pv(vtkTemp1) CreatePVSource Glyph]
set pv(vtkTemp204) [$pv(vtkTemp183) GetPVWidget {OrientScale}]
$pv(vtkTemp204) SetScaleFactor 0.2
$pv(vtkTemp204) SetOrientMode "Off"
$pv(vtkTemp183) AcceptCallback


set pv(vtkTemp217) [$pv(vtkTemp1) CreatePVSource SphereSource]
set pv(vtkTemp229) [$pv(vtkTemp217) GetPVWidget {Center}]
$pv(vtkTemp229) SetValue 1.5 0 0
$pv(vtkTemp217) AcceptCallback
$pv(vtkTemp1) ResetCameraCallback
set pv(vtkTemp262) [$pv(vtkTemp1) CreatePVSource Glyph]
set pv(vtkTemp271) [$pv(vtkTemp262) GetPVWidget {Glyph}]
$pv(vtkTemp271) SetCurrentValue $pv(vtkTemp93)
set pv(vtkTemp283) [$pv(vtkTemp262) GetPVWidget {OrientScale}]
$pv(vtkTemp283) SetScaleFactor 0.2
$pv(vtkTemp262) AcceptCallback

# Test deleting before accept is called.
#set pv(vtkTemp296) [$pv(vtkTemp1) CreatePVSource vtkSphereSource]
#$pv(vtkTemp296) DeleteCallback
#$pv(vtkTemp1) SetCurrentPVSource $pv(vtkTemp262)
#$pv(vtkTemp1) ShowCurrentSourceProperties

set pv(vtkTemp333) [$pv(vtkTemp1) CreatePVSource SphereSource]
set pv(vtkTemp345) [$pv(vtkTemp333) GetPVWidget {Center}]
$pv(vtkTemp345) SetValue 0 1.5 0
$pv(vtkTemp333) AcceptCallback
set pv(vtkTemp378) [$pv(vtkTemp1) CreatePVSource Glyph]
set pv(vtkTemp399) [$pv(vtkTemp378) GetPVWidget {OrientScale}]
$pv(vtkTemp399) SetScaleFactor 1
$pv(vtkTemp378) AcceptCallback
set pv(vtkTemp387) [$pv(vtkTemp378) GetPVWidget {Glyph}]
$pv(vtkTemp387) SetCurrentValue $pv(vtkTemp97)
$pv(vtkTemp399) SetScaleFactor 0.1
$pv(vtkTemp378) AcceptCallback

set pv(vtkTemp412) [$pv(vtkTemp1) CreatePVSource SphereSource]
set pv(vtkTemp424) [$pv(vtkTemp412) GetPVWidget {Center}]
$pv(vtkTemp424) SetValue 1.5 1.5 0
$pv(vtkTemp412) AcceptCallback
$pv(vtkTemp1) ResetCameraCallback
$pv(vtkTemp1) SetCurrentPVSource $pv(vtkTemp183)
$pv(vtkTemp1) ShowCurrentSourceProperties
set pv(vtkTemp191) [$pv(vtkTemp183) GetPVWidget {Input}]
$pv(vtkTemp191) SetCurrentValue $pv(vtkTemp412)
$pv(vtkTemp204) SetScaleFactor 0.2
$pv(vtkTemp183) AcceptCallback
$pv(vtkTemp183) AcceptCallback
$pv(vtkTemp1) SetCurrentPVSource $pv(vtkTemp98)
$pv(vtkTemp1) ShowCurrentSourceProperties
set pv(vtkTemp458) [$pv(vtkTemp1) CreatePVSource Glyph]
set pv(vtkTemp479) [$pv(vtkTemp458) GetPVWidget {OrientScale}]
$pv(vtkTemp479) SetScaleFactor 0.4
$pv(vtkTemp458) AcceptCallback


# Fix the size of the image.
set RenWin1 [[[$Application GetMainWindow] GetMainView] GetRenderWindow]
$RenWin1 SetSize 300 300
$RenWin1 Render
update

for {set i  1} {$i < [expr $argc - 1]} {incr i} {
    if {[lindex $argv $i] == "-C"} {
	source [lindex $argv [expr $i + 1]]
	$Application SetExitStatus [CompareImage [[$Application GetMainWindow] GetMainView]]
    }
}
   
$Application Exit








