This file is indexed.

/usr/share/savi/tcl/snapshot.tcl is in savi 1.4.6-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#
######################################################
#
#  SaVi by Lloyd Wood (lloydwood@users.sourceforge.net),
#          Patrick Worfolk (worfolk@alum.mit.edu) and
#          Robert Thurman.
#
#  Copyright (c) 1997 by The Geometry Center.
#  Also Copyright (c) 2013 by Lloyd Wood.
#
#  This file is part of SaVi.  SaVi is free software;
#  you can redistribute it and/or modify it only under
#  the terms given in the file COPYRIGHT which you should
#  have received along with this file.  SaVi may be
#  obtained from:
#  http://savi.sourceforge.net/
#  http://www.geom.uiuc.edu/locate/SaVi
#
######################################################
#
# large_snapshot.tcl
#
# $Id: snapshot.tcl,v 1.10 2013/05/05 05:19:26 lloydwood Exp $

proc snapshot(build) {} {
    global rendering_size

    if {[eval window(raise) snapshot]} return

    set name [build_Toplevel snapshot]

    wm protocol $name WM_DELETE_WINDOW snapshot(dismiss)

    build_Title $name "Choose size of snapshot to save..."

    set cmd [build_CmdFrame $name cmd]

    build_LabelEntryColumns $cmd x \
        {ientry "pixels across (x)" rendering_size(x)}
    build_LabelEntryColumns $cmd y \
        {ientry "pixels down (y)" rendering_size(y)}

    bind $cmd.x.c0 <Return> "snapshot(save)"
    bind $cmd.y.c0 <Tab> "snapshot(save)"

    pack $cmd -fill both -expand 1

    build_Buttonbar $name dbbar \
        {"Save snapshot" "snapshot(save)"} \
	{"Cancel" "snapshot(dismiss)"}

    update
}

proc snapshot(dismiss) {} {

    destroy .snapshot
}

proc snapshot(save) {} {
    global footprints_flag texture_flag geomview_dynamic_texture_flag \
	   fast_marker_sat_flag sphere_sat_flag rendering_size

    snapshot(dismiss)

    set types {
        {"SaVi high-quality rendering" {.ppm} }
    }

    set filename [tk_getSaveFile -filetypes $types \
	          -title "SaVi: save rendering to folder" ]

    if {"$filename" == ""} return

    set filename [save(extension) "$filename" ppm]

    set footprints_on 0
    set texture_off 0
    set marker_off 0

    geomview(begin)

    # texturemapping doesn't appear in software snapshot,
    # so coverage footprints substitute.
    if {($texture_flag == 1) && ($geomview_dynamic_texture_flag == 1)} {
	set texture_flag 0
	set texture_off 0
	if {$footprints_flag == 0} {
	    set footprints_flag 1
	    set footprints_on 1
	}
    }

    # marker blobs are too small; spheres scales.
    if {$fast_marker_sat_flag == 1} {
	set fast_marker_sat_flag 0
	set marker_off 1
    }

    # change to white for print
    geomview(puts) "(backcolor focus 1 1 1)"

    geomview(puts) "(snapshot focus \"$filename\" ppm $rendering_size(x) $rendering_size(y))"

    # change back to current color
    geomview(set_background_color)

    if {$marker_off == 1} {
	set fast_marker_sat_flag 1
    }
    if {$footprints_on == 1} {
	set footprints_flag 0
    }
    if {$texture_off == 1} {
	set texture_flag 1
    }

    geomview(end)
}