/usr/lib/ruby/vendor_ruby/ctioga2/graphics/elements/contour.rb is in ctioga2 0.10-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 | # contour.rb: contouring code for XYZ data
# copyright (c) 2010, 2011 by Vincent Fourmond
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details (in the COPYING file).
require 'ctioga2/graphics/elements/primitive'
# This module contains all the classes used by ctioga
module CTioga2
module Graphics
module Elements
module Contours
ContoursOptions = {
'width' => 'float',
'color' => 'color',
'style' => 'line-style',
'closed' => 'boolean',
}
## @todo Maybe this cumbersome level/point thing along with the
# $last_curve_style calls for a context for the primitive, ie
# which was the state of the dataset/curve stack at the moment
# when the primitive was drawn ?
#
# Worse, I already designed something better. I'll need to get
# that straight some day.
TiogaPrimitiveCall.
primitive("contour", "contour", [ 'level'],
ContoursOptions) do |t, level,options|
options ||= {}
# table = PlotMaker.plotmaker.data_stack.last.indexed_table
l, d = *level
table = d.indexed_table
contour = table.make_contour(l)
contour << options['closed']
## @todo This $last_curve_style isn't beautiful.
##
## Worse, it won't work !
options['color'] ||= $last_curve_style.line.color
stroke_style = Styles::StrokeStyle.from_hash(options, '%s')
t.context do
stroke_style.set_stroke_style(t)
t.append_points_with_gaps_to_path(*contour)
t.stroke
end
end
end
end
end
end
|