ctioga2 0.10 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Changelog +7 -0
- data/bin/ct2-make-movie +17 -0
- data/lib/ctioga2/graphics/elements/primitive.rb +2 -2
- data/lib/ctioga2/graphics/elements/redirecting-container.rb +6 -19
- data/lib/ctioga2/graphics/elements/region.rb +2 -1
- data/lib/ctioga2/graphics/elements/tangent.rb +2 -1
- data/lib/ctioga2/graphics/styles/image.rb +1 -1
- data/lib/ctioga2/version.rb +2 -2
- metadata +2 -2
data/Changelog
CHANGED
data/bin/ct2-make-movie
CHANGED
@@ -139,6 +139,8 @@ encoders = [ EncodingJob.new ]
|
|
139
139
|
cur_enc = encoders.first
|
140
140
|
|
141
141
|
|
142
|
+
ct2_extra_args = []
|
143
|
+
|
142
144
|
opts = OptionParser.new do |opts|
|
143
145
|
opts.banner = "Usage: #$0 [options] file.ct2 arguments..."
|
144
146
|
|
@@ -197,6 +199,20 @@ opts = OptionParser.new do |opts|
|
|
197
199
|
end
|
198
200
|
|
199
201
|
|
202
|
+
opts.on("", "--ctioga2-args ARGS", "Extra args for ctioga2") do |v|
|
203
|
+
ct2_extra_args += Shellwords.split(v)
|
204
|
+
end
|
205
|
+
|
206
|
+
opts.on("-s", "--set EXPR", "Sets the given variable") do |t|
|
207
|
+
l = t.split(/\s*=\s*/, 2)
|
208
|
+
if l.size != 2
|
209
|
+
puts "The argument of --set must be in the form 'variable=value'"
|
210
|
+
exit 1
|
211
|
+
end
|
212
|
+
ct2_extra_args += ['--set', *l]
|
213
|
+
end
|
214
|
+
|
215
|
+
|
200
216
|
end
|
201
217
|
|
202
218
|
opts.parse!(ARGV)
|
@@ -260,6 +276,7 @@ for f in args
|
|
260
276
|
name = format % index
|
261
277
|
|
262
278
|
ct2_cmdline = [ct2,
|
279
|
+
*ct2_extra_args,
|
263
280
|
"--set", "arg", f,
|
264
281
|
"--set", "index", "#{index}",
|
265
282
|
"-f", file, "--name", name, "-r", ct2_page_size]
|
@@ -114,7 +114,7 @@ module CTioga2
|
|
114
114
|
|
115
115
|
# Now, create the command
|
116
116
|
cmd_args = comp.map do |x|
|
117
|
-
if x.
|
117
|
+
if x.is_a? CmdArg
|
118
118
|
x
|
119
119
|
else
|
120
120
|
CmdArg.new(x)
|
@@ -123,7 +123,7 @@ module CTioga2
|
|
123
123
|
|
124
124
|
cmd_opts = {}
|
125
125
|
for k,v in opts
|
126
|
-
cmd_opts[k] = if v.
|
126
|
+
cmd_opts[k] = if v.is_a? CmdArg
|
127
127
|
v
|
128
128
|
else
|
129
129
|
CmdArg.new(v)
|
@@ -15,6 +15,8 @@
|
|
15
15
|
require 'ctioga2/utils'
|
16
16
|
require 'ctioga2/log'
|
17
17
|
|
18
|
+
require 'forwardable'
|
19
|
+
|
18
20
|
module CTioga2
|
19
21
|
|
20
22
|
module Graphics
|
@@ -24,6 +26,8 @@ module CTioga2
|
|
24
26
|
# A Container that redirect most of its trafic to the parents.
|
25
27
|
class RedirectingContainer < Container
|
26
28
|
|
29
|
+
extend Forwardable
|
30
|
+
|
27
31
|
###########################################
|
28
32
|
# The following functions are plain redirections to the
|
29
33
|
# parent.
|
@@ -32,27 +36,10 @@ module CTioga2
|
|
32
36
|
# redirection in the form of an accessor. Using forwardable
|
33
37
|
# should do
|
34
38
|
|
35
|
-
def style(*a)
|
36
|
-
return parent.style(*a)
|
37
|
-
end
|
38
|
-
|
39
|
-
def add_legend_item(item)
|
40
|
-
return parent.add_legend_item(item)
|
41
|
-
end
|
42
|
-
|
43
|
-
def legend_area=(l)
|
44
|
-
return parent.legend_area = l
|
45
|
-
end
|
46
|
-
|
47
39
|
undef :gp_cache, :gp_cache=
|
48
|
-
|
49
|
-
def gp_cache
|
50
|
-
return parent.gp_cache
|
51
|
-
end
|
52
40
|
|
53
|
-
|
54
|
-
|
55
|
-
end
|
41
|
+
def_delegators :parent, :style, :add_legend_item, :legend_area=,
|
42
|
+
:gp_cache, :gp_cache=, :set_user_boundaries
|
56
43
|
|
57
44
|
def each_item(leaf_only = true, recursive = false, tl = true, &blk)
|
58
45
|
if tl
|
@@ -41,6 +41,7 @@ module CTioga2
|
|
41
41
|
# Creates a new empty region
|
42
42
|
def initialize(parent = nil, root = nil)
|
43
43
|
@parent = parent
|
44
|
+
@clipped = true # clipped by default !
|
44
45
|
|
45
46
|
# elements to be given to tioga
|
46
47
|
@curves = []
|
@@ -85,7 +86,7 @@ module CTioga2
|
|
85
86
|
def real_do(t)
|
86
87
|
# This function will be called with the proper figure
|
87
88
|
# coordinates.
|
88
|
-
|
89
|
+
|
89
90
|
if @fill_style.color
|
90
91
|
t.context do
|
91
92
|
@fill_style.setup_fill(t)
|
@@ -85,7 +85,8 @@ module CTioga2
|
|
85
85
|
style = Styles::StyleSheet.style_for(Styles::ArrowStyle ,st_name)
|
86
86
|
style.set_from_hash(options)
|
87
87
|
|
88
|
-
|
88
|
+
coords = options['tail'] + options['head']
|
89
|
+
style.draw_arrow(t, *coords)
|
89
90
|
end
|
90
91
|
end
|
91
92
|
|
data/lib/ctioga2/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ctioga2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.10.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-03-
|
12
|
+
date: 2014-03-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: tioga
|