tkar 0.63 → 0.64
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/COPYING +22 -0
- data/README.md +142 -0
- data/Rakefile +64 -0
- data/{FAQ.rdoc → doc/faq.md} +9 -9
- data/{History.txt → doc/old-history.txt} +4 -0
- data/{protocol.rdoc → doc/protocol.md} +213 -210
- data/lib/tkar/version.rb +1 -2
- metadata +44 -78
- data/.gitignore +0 -5
- data/README.rdoc +0 -153
- data/TODO +0 -67
- data/bin/tkar +0 -104
- data/examples/s +0 -3
- data/install.rb +0 -1015
- data/rakefile +0 -56
- data/tasks/ann.rake +0 -80
- data/tasks/bones.rake +0 -20
- data/tasks/gem.rake +0 -201
- data/tasks/git.rake +0 -40
- data/tasks/notes.rake +0 -27
- data/tasks/post_load.rake +0 -34
- data/tasks/rdoc.rake +0 -51
- data/tasks/rubyforge.rake +0 -55
- data/tasks/setup.rb +0 -292
- data/tasks/spec.rake +0 -54
- data/tasks/svn.rake +0 -47
- data/tasks/test.rake +0 -40
- data/tasks/zentest.rake +0 -36
data/lib/tkar/version.rb
CHANGED
metadata
CHANGED
@@ -1,63 +1,42 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: tkar
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '0.64'
|
5
5
|
platform: ruby
|
6
|
-
authors:
|
6
|
+
authors:
|
7
7
|
- Joel VanderWerf
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
- !ruby/object:Gem::Dependency
|
16
|
-
name: bones
|
17
|
-
type: :development
|
18
|
-
version_requirement:
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
20
|
-
requirements:
|
21
|
-
- - ">="
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version: 2.5.1
|
24
|
-
version:
|
25
|
-
description: |
|
26
|
-
The Tkar animator aims to do one thing well: listen to an incoming stream of
|
27
|
-
data and animate it in a 2D canvas. User interaction is streamed back out.
|
28
|
-
|
11
|
+
date: 2014-01-25 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Tkar listens to an incoming stream of data and animates it in a 2D canvas.
|
14
|
+
User interaction is streamed back out.
|
29
15
|
email: vjoel@users.sourceforge.net
|
30
|
-
executables:
|
31
|
-
- tkar
|
16
|
+
executables: []
|
32
17
|
extensions: []
|
33
|
-
|
34
|
-
|
35
|
-
-
|
36
|
-
|
37
|
-
-
|
38
|
-
-
|
39
|
-
-
|
40
|
-
|
41
|
-
- .
|
42
|
-
-
|
43
|
-
- History.txt
|
44
|
-
- README.rdoc
|
45
|
-
- TODO
|
46
|
-
- bin/tkar
|
18
|
+
extra_rdoc_files:
|
19
|
+
- README.md
|
20
|
+
- COPYING
|
21
|
+
files:
|
22
|
+
- COPYING
|
23
|
+
- README.md
|
24
|
+
- Rakefile
|
25
|
+
- doc/faq.md
|
26
|
+
- doc/old-history.txt
|
27
|
+
- doc/protocol.md
|
47
28
|
- examples/dial.rb
|
48
29
|
- examples/help.gif
|
49
30
|
- examples/home.gif
|
50
31
|
- examples/mkgrid.rb
|
51
32
|
- examples/ps.rb
|
52
33
|
- examples/rotate
|
53
|
-
- examples/s
|
54
34
|
- examples/sample
|
55
35
|
- examples/sample.rb
|
56
36
|
- examples/sample2
|
57
37
|
- examples/sample3
|
58
38
|
- examples/server.rb
|
59
39
|
- examples/tavis.rb
|
60
|
-
- install.rb
|
61
40
|
- lib/tkar.rb
|
62
41
|
- lib/tkar/argos.rb
|
63
42
|
- lib/tkar/canvas.rb
|
@@ -68,49 +47,36 @@ files:
|
|
68
47
|
- lib/tkar/tkaroid.rb
|
69
48
|
- lib/tkar/version.rb
|
70
49
|
- lib/tkar/window.rb
|
71
|
-
|
72
|
-
|
73
|
-
-
|
74
|
-
|
75
|
-
- tasks/gem.rake
|
76
|
-
- tasks/git.rake
|
77
|
-
- tasks/notes.rake
|
78
|
-
- tasks/post_load.rake
|
79
|
-
- tasks/rdoc.rake
|
80
|
-
- tasks/rubyforge.rake
|
81
|
-
- tasks/setup.rb
|
82
|
-
- tasks/spec.rake
|
83
|
-
- tasks/svn.rake
|
84
|
-
- tasks/test.rake
|
85
|
-
- tasks/zentest.rake
|
86
|
-
has_rdoc: true
|
87
|
-
homepage: http://rubyforge.org/projects/tkar/
|
88
|
-
licenses: []
|
89
|
-
|
50
|
+
homepage: https://github.com/vjoel/tkar
|
51
|
+
licenses:
|
52
|
+
- BSD
|
53
|
+
metadata: {}
|
90
54
|
post_install_message:
|
91
|
-
rdoc_options:
|
92
|
-
- --
|
93
|
-
-
|
94
|
-
|
55
|
+
rdoc_options:
|
56
|
+
- "--quiet"
|
57
|
+
- "--line-numbers"
|
58
|
+
- "--inline-source"
|
59
|
+
- "--title"
|
60
|
+
- Tkar
|
61
|
+
- "--main"
|
62
|
+
- README.md
|
63
|
+
require_paths:
|
95
64
|
- lib
|
96
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
97
|
-
requirements:
|
65
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
98
67
|
- - ">="
|
99
|
-
- !ruby/object:Gem::Version
|
100
|
-
version:
|
101
|
-
|
102
|
-
|
103
|
-
requirements:
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
104
72
|
- - ">="
|
105
|
-
- !ruby/object:Gem::Version
|
106
|
-
version:
|
107
|
-
version:
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
108
75
|
requirements: []
|
109
|
-
|
110
|
-
|
111
|
-
rubygems_version: 1.3.5
|
76
|
+
rubyforge_project:
|
77
|
+
rubygems_version: 2.2.1
|
112
78
|
signing_key:
|
113
|
-
specification_version:
|
79
|
+
specification_version: 4
|
114
80
|
summary: Generic 2D animation tool
|
115
81
|
test_files: []
|
116
|
-
|
82
|
+
has_rdoc:
|
data/README.rdoc
DELETED
@@ -1,153 +0,0 @@
|
|
1
|
-
= <b>tkar</b> -- Tk-based animation process and protocol
|
2
|
-
|
3
|
-
The Tkar animator aims to do one thing well: listen to an incoming stream of data and animate it in a 2D canvas. User interaction is streamed back out.
|
4
|
-
|
5
|
-
To skip to the protocol documentation: {protocol}[link:files/protocol_rdoc.html].
|
6
|
-
|
7
|
-
Also of interest:
|
8
|
-
{FAQ}[link:files/FAQ_rdoc.html].
|
9
|
-
|
10
|
-
== Overview
|
11
|
-
|
12
|
-
Tkar is a Tk/ruby-based animation program using TkCanvas. It accepts command input from stdin or a socket. Commands may define parametrized shapes, place them on the canvas, move and rotate them, change parameters, etc. User interaction events (click, drag, etc) are sent back on the socket or stdout. The canvas can be resized, scrolled, zoomed, and tracked to an object.
|
13
|
-
|
14
|
-
=== Graphical constructs
|
15
|
-
|
16
|
-
* Shapes include: arc, oval, polygon, line, curve, text, bitmap.
|
17
|
-
|
18
|
-
* Parameters include color/pattern of border/area, arrowheads, splines, line dot/dash/width, text font, etc.
|
19
|
-
|
20
|
-
* Can group, layer, rotate, move, and scale objects
|
21
|
-
|
22
|
-
=== Tkar command summary
|
23
|
-
|
24
|
-
_shape_:: define shape in terms of primitives (Tk Canvas objects). Shape may expose any Tk parameters (e.g, colors, lengths of poly sides)
|
25
|
-
|
26
|
-
_add_:: add object to canvas with specified shape, layer, position, rotation, params
|
27
|
-
|
28
|
-
_move_, _rotate_, _scale_, _delete_:: operate on existing object
|
29
|
-
|
30
|
-
_param_:: change param value of an object (e.g. change color or geometry over time; change arrow shape because endpoint moves)
|
31
|
-
|
32
|
-
utilities:: _wait_ (playback with specified frame rate), _update_ (end of time step), set window _params_ (color, size, zoom), _follow_ a specified object, _load_ file (like #include)
|
33
|
-
|
34
|
-
=== User interaction
|
35
|
-
|
36
|
-
* Use keys and mouse to zoom, pan/scroll, select, double-click, drag, drop, etc.
|
37
|
-
|
38
|
-
* User commands are sent back over stream to controlling process
|
39
|
-
e.g. "drag 2 140.0 259.0" and "drop 2 7" ("2" and "7" are object ids)
|
40
|
-
|
41
|
-
|
42
|
-
== Installation
|
43
|
-
|
44
|
-
=== Prerequisites
|
45
|
-
|
46
|
-
==== Tcl/Tk
|
47
|
-
|
48
|
-
For windows: http://www.activestate.com/Products/ActiveTcl/
|
49
|
-
|
50
|
-
For linux, just use your distribution's package tool to install tcl. However, you may need to make sure that ruby and linux both use (or do not use) the pthread library.
|
51
|
-
|
52
|
-
==== Ruby
|
53
|
-
|
54
|
-
For windows: http://rubyforge.org/projects/rubyinstaller/
|
55
|
-
|
56
|
-
For other platforms: http://www.ruby-lang.org
|
57
|
-
|
58
|
-
=== Gem installation
|
59
|
-
|
60
|
-
gem install tkar
|
61
|
-
|
62
|
-
=== Tarball installation
|
63
|
-
|
64
|
-
Alternately, you can download and unpack the source code tar ball from rubyforge:
|
65
|
-
|
66
|
-
wget ...
|
67
|
-
tar xzvf ...
|
68
|
-
cd ...
|
69
|
-
|
70
|
-
You can then either install it as follows:
|
71
|
-
|
72
|
-
ruby install.rb config
|
73
|
-
ruby install.rb setup
|
74
|
-
ruby install.rb install
|
75
|
-
|
76
|
-
or you can run it in place using the <tt>--local-lib</tt> command line option
|
77
|
-
|
78
|
-
bin/tkar --local-lib
|
79
|
-
|
80
|
-
|
81
|
-
== Usage
|
82
|
-
|
83
|
-
=== Command line
|
84
|
-
|
85
|
-
See the -h command line option for details on running tkar.
|
86
|
-
|
87
|
-
Examples are available with the source code--read the comments to see how to run.
|
88
|
-
|
89
|
-
=== Tkar window
|
90
|
-
|
91
|
-
Press the "h" key for on-line help using the tkar window.
|
92
|
-
|
93
|
-
=== Protocol
|
94
|
-
|
95
|
-
See {protocol}[link:files/protocol_rdoc.html] for details on the protocol and writing shape files.
|
96
|
-
|
97
|
-
=== Integrating tkar with other applications
|
98
|
-
|
99
|
-
There are three transport options:
|
100
|
-
|
101
|
-
1. Over pipe
|
102
|
-
|
103
|
-
cat data | tkar
|
104
|
-
|
105
|
-
or
|
106
|
-
|
107
|
-
program | tkar
|
108
|
-
|
109
|
-
- unidirectional (no mouseclick feedback to program)
|
110
|
-
|
111
|
-
- output messages simply go to stdout
|
112
|
-
|
113
|
-
- easy to write filters this way
|
114
|
-
|
115
|
-
<tt></tt>
|
116
|
-
|
117
|
-
2. Over TCP socket
|
118
|
-
|
119
|
-
tkar [<ipaddr>] <port>
|
120
|
-
|
121
|
-
- bidirectional; client can block waiting for update to finish
|
122
|
-
|
123
|
-
- remote host possible, using ipaddr=="localhost"
|
124
|
-
|
125
|
-
- if port is 0, lets OS choose port and prints it to stderr
|
126
|
-
|
127
|
-
- can still write filters by using netcat
|
128
|
-
|
129
|
-
<tt></tt>
|
130
|
-
|
131
|
-
3. Over unix domain socket
|
132
|
-
|
133
|
-
tkar /path/to/socket
|
134
|
-
|
135
|
-
- bidirectional; client can block waiting for update to finish
|
136
|
-
|
137
|
-
- faster than TCP (but unix/linux only)
|
138
|
-
|
139
|
-
Note that tkar has a -c option which tells it to be the socket client rather than the server. This is useful when your main program needs to choose the port, for example.
|
140
|
-
|
141
|
-
== Tkar and Simulink
|
142
|
-
|
143
|
-
Tkar can be interfaced with Simulink. Tkar appears in a simulink model as a block to which can be wired to any number of data sources that drive objects in the animation. You can have several tkar blocks. Think of tkar as the animation version of the built-in plotting block. (Simulink's built-in animation capabilities are bad.)
|
144
|
-
|
145
|
-
An additional set of C files need to be compiled as a Simulink extension. Contact author for details.
|
146
|
-
|
147
|
-
== Author
|
148
|
-
|
149
|
-
Copyright 2006-2009, Joel VanderWerf, mailto:vjoel@users.sourceforge.org
|
150
|
-
|
151
|
-
== License
|
152
|
-
|
153
|
-
Ruby license, see http://www.ruby-lang.org.
|
data/TODO
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
switch for protocol N, if protocol changes
|
2
|
-
|
3
|
-
make most add arguments optional
|
4
|
-
|
5
|
-
height/width broken after user resizes
|
6
|
-
|
7
|
-
set select/hover colors
|
8
|
-
|
9
|
-
set radian/degrees, flip y
|
10
|
-
|
11
|
-
examples for web site
|
12
|
-
screen shots
|
13
|
-
|
14
|
-
new options:
|
15
|
-
|
16
|
-
--flip-shape --radian-shape
|
17
|
-
|
18
|
-
--flip-gobal --radian-global [ replaces --flip and --radians ]
|
19
|
-
|
20
|
-
--flip --radians [ implies both of above, resp. ]
|
21
|
-
|
22
|
-
OR: do these as commands rather than options !!!
|
23
|
-
|
24
|
-
new kind of object: connector
|
25
|
-
|
26
|
-
connects and moves with n normal objects
|
27
|
-
|
28
|
-
defined in terms of a shape which has 3*n params: x,y,r of each part
|
29
|
-
|
30
|
-
also xdelta and ydelta, in each part's local coord sys?
|
31
|
-
|
32
|
-
instantiated by passing ids of n objects, plus any add'l params
|
33
|
-
|
34
|
-
when objects move, connector's params are changed accordingly, reshaping it
|
35
|
-
|
36
|
-
(even when objects dragged in gui)
|
37
|
-
|
38
|
-
when connector is dragged, objects are dragged with it (?)
|
39
|
-
|
40
|
-
a connector with n==1 is a useful special case (control point, port, etc.)
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
constrained drag motion, drop targets (per individual object)
|
45
|
-
|
46
|
-
constrain by ID(s) of object(s) that drag must stay within
|
47
|
-
|
48
|
-
object flags
|
49
|
-
|
50
|
-
draggable, hoverable, etc
|
51
|
-
|
52
|
-
import shapes from .svg, so you can draw them in Dia, etc.
|
53
|
-
|
54
|
-
documentation
|
55
|
-
|
56
|
-
shape vs global coords
|
57
|
-
|
58
|
-
how to write line labels in simulink
|
59
|
-
|
60
|
-
tutorial
|
61
|
-
|
62
|
-
- simplest possible animation
|
63
|
-
|
64
|
-
- more complex shapes
|
65
|
-
|
66
|
-
- more complex motion
|
67
|
-
|
data/bin/tkar
DELETED
@@ -1,104 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
local_lib_dir = File.join(File.dirname(File.dirname(__FILE__)), "lib")
|
4
|
-
|
5
|
-
if ARGV.delete("--local-lib")
|
6
|
-
$LOAD_PATH.unshift local_lib_dir
|
7
|
-
end
|
8
|
-
|
9
|
-
require 'tkar/argos'
|
10
|
-
|
11
|
-
optdef = {
|
12
|
-
"b" => true,
|
13
|
-
"c" => true,
|
14
|
-
"h" => true,
|
15
|
-
"help" => true,
|
16
|
-
"v" => true,
|
17
|
-
"persist" => true,
|
18
|
-
"radians" => true,
|
19
|
-
"flip" => true,
|
20
|
-
"stderr" => proc {|arg| arg},
|
21
|
-
"version" => true
|
22
|
-
}
|
23
|
-
|
24
|
-
opts = Argos.parse_options(ARGV, optdef)
|
25
|
-
|
26
|
-
stderr_file = opts["stderr"]
|
27
|
-
if stderr_file
|
28
|
-
begin
|
29
|
-
$stderr = File.open(stderr_file, "w")
|
30
|
-
rescue
|
31
|
-
$stderr.puts "Warning: could not open #{stderr_file} for writing."
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
$0 = "tkar"
|
36
|
-
|
37
|
-
if opts["h"] or opts["help"]
|
38
|
-
puts <<-END
|
39
|
-
|
40
|
-
#{$0} [options] [addr] [port]
|
41
|
-
|
42
|
-
Start a tkar animation process. Its inputs and outputs are one of:
|
43
|
-
|
44
|
-
stdin/stdout: this is the default
|
45
|
-
|
46
|
-
TCP socket: if port is given (addr default is 127.0.0.1)
|
47
|
-
|
48
|
-
UNIX socket: if addr only is given
|
49
|
-
|
50
|
-
Options:
|
51
|
-
|
52
|
-
-b turns on binary protocol mode, otherwise uses ascii
|
53
|
-
|
54
|
-
-c act as client instead of server [socket cases only];
|
55
|
-
attempts to connect to specified address
|
56
|
-
|
57
|
-
-h this help
|
58
|
-
--help
|
59
|
-
|
60
|
-
-v be verbose
|
61
|
-
|
62
|
-
--version print version information and exit
|
63
|
-
|
64
|
-
--local-lib look for tkar lib files at path relative to this
|
65
|
-
program (currently, #{local_lib_dir})
|
66
|
-
|
67
|
-
--persist keep window open after finishing (even in
|
68
|
-
case of errors)
|
69
|
-
|
70
|
-
--radians accept rotation input in radians instead of degrees;
|
71
|
-
doesn't affect coords inside shapes
|
72
|
-
|
73
|
-
--flip flips the global y axis, affecting both input
|
74
|
-
and output; doesn't affect coords inside shapes
|
75
|
-
|
76
|
-
END
|
77
|
-
exit
|
78
|
-
end
|
79
|
-
|
80
|
-
if opts["version"]
|
81
|
-
require 'tkar/version'
|
82
|
-
puts Tkar::Version
|
83
|
-
exit
|
84
|
-
end
|
85
|
-
|
86
|
-
require 'tkar'
|
87
|
-
|
88
|
-
# so io errors kill the whole process instead of just one thread.
|
89
|
-
Thread.abort_on_exception = true
|
90
|
-
|
91
|
-
if defined?(REQUIRE2LIB) # for rubyscript2exe
|
92
|
-
require 'tk/root'
|
93
|
-
require 'tk/frame'
|
94
|
-
require 'tk/bindtag'
|
95
|
-
require 'tk/pack'
|
96
|
-
require 'tk/grid'
|
97
|
-
require 'tk/scrollbar'
|
98
|
-
require 'tk/virtevent'
|
99
|
-
require 'tk/timer'
|
100
|
-
require 'tk/variable'
|
101
|
-
exit
|
102
|
-
end
|
103
|
-
|
104
|
-
Tkar.run(ARGV, opts)
|