extract_curves 0.0.1-i586-linux

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.
Files changed (99) hide show
  1. data/CVS/Entries +4 -0
  2. data/CVS/Repository +1 -0
  3. data/CVS/Root +1 -0
  4. data/bin/CVS/Entries +5 -0
  5. data/bin/CVS/Repository +1 -0
  6. data/bin/CVS/Root +1 -0
  7. data/bin/ec_rect2polar.rb +22 -0
  8. data/bin/ec_rev_lines.rb +5 -0
  9. data/bin/ec_sph_area.rb +30 -0
  10. data/bin/extract_curves.rb +2145 -0
  11. data/ruby_ext/CVS/Entries +1 -0
  12. data/ruby_ext/CVS/Repository +1 -0
  13. data/ruby_ext/CVS/Root +1 -0
  14. data/ruby_ext/pav/CVS/Entries +14 -0
  15. data/ruby_ext/pav/CVS/Repository +1 -0
  16. data/ruby_ext/pav/CVS/Root +1 -0
  17. data/ruby_ext/pav/extconf.rb +22 -0
  18. data/ruby_ext/pav/pav.so +0 -0
  19. data/ruby_libs/CVS/Entries +1 -0
  20. data/ruby_libs/CVS/Repository +1 -0
  21. data/ruby_libs/CVS/Root +1 -0
  22. data/ruby_libs/pav/CVS/Entries +20 -0
  23. data/ruby_libs/pav/CVS/Repository +1 -0
  24. data/ruby_libs/pav/CVS/Root +1 -0
  25. data/ruby_libs/pav/attr_cache.rb +211 -0
  26. data/ruby_libs/pav/attr_cache.t1.rb +32 -0
  27. data/ruby_libs/pav/cache.rb +31 -0
  28. data/ruby_libs/pav/dbg_log.rb +458 -0
  29. data/ruby_libs/pav/floatsio.rb +53 -0
  30. data/ruby_libs/pav/generator_cache.rb +165 -0
  31. data/ruby_libs/pav/gtk/CVS/Entries +4 -0
  32. data/ruby_libs/pav/gtk/CVS/Repository +1 -0
  33. data/ruby_libs/pav/gtk/CVS/Root +1 -0
  34. data/ruby_libs/pav/gtk/button.rb +130 -0
  35. data/ruby_libs/pav/gtk/icons.rb +87 -0
  36. data/ruby_libs/pav/gtk/toolbar.rb +192 -0
  37. data/ruby_libs/pav/heap.rb +54 -0
  38. data/ruby_libs/pav/icons/CVS/Entries +17 -0
  39. data/ruby_libs/pav/icons/CVS/Repository +1 -0
  40. data/ruby_libs/pav/icons/CVS/Root +1 -0
  41. data/ruby_libs/pav/icons/alt_handle.xpm +3832 -0
  42. data/ruby_libs/pav/icons/alt_handle_hover.xpm +3368 -0
  43. data/ruby_libs/pav/icons/alt_handle_pressed.xpm +3828 -0
  44. data/ruby_libs/pav/icons/extract_curves/CVS/Entries +6 -0
  45. data/ruby_libs/pav/icons/extract_curves/CVS/Repository +1 -0
  46. data/ruby_libs/pav/icons/extract_curves/CVS/Root +1 -0
  47. data/ruby_libs/pav/icons/extract_curves/extract_curves-icon-rgb.ppm +14 -0
  48. data/ruby_libs/pav/icons/extract_curves/extract_curves-logo-rgb.gif +0 -0
  49. data/ruby_libs/pav/icons/extract_curves/trace_mark.xpm +38 -0
  50. data/ruby_libs/pav/icons/handle.xpm +213 -0
  51. data/ruby_libs/pav/icons/next.xpm +29 -0
  52. data/ruby_libs/pav/icons/next_hover.xpm +315 -0
  53. data/ruby_libs/pav/icons/next_pressed.xpm +144 -0
  54. data/ruby_libs/pav/icons/prev.xpm +29 -0
  55. data/ruby_libs/pav/icons/prev_hover.xpm +315 -0
  56. data/ruby_libs/pav/icons/prev_pressed.xpm +144 -0
  57. data/ruby_libs/pav/icons/vnext.xpm +29 -0
  58. data/ruby_libs/pav/icons/vprev.xpm +29 -0
  59. data/ruby_libs/pav/numeric/CVS/Entries +2 -0
  60. data/ruby_libs/pav/numeric/CVS/Repository +1 -0
  61. data/ruby_libs/pav/numeric/CVS/Root +1 -0
  62. data/ruby_libs/pav/numeric/ext.rb +13 -0
  63. data/ruby_libs/pav/pav_find.rb +90 -0
  64. data/ruby_libs/pav/pix/CVS/Entries +11 -0
  65. data/ruby_libs/pav/pix/CVS/Repository +1 -0
  66. data/ruby_libs/pav/pix/CVS/Root +1 -0
  67. data/ruby_libs/pav/pix/aapix.rb +378 -0
  68. data/ruby_libs/pav/pix/blob.rb +543 -0
  69. data/ruby_libs/pav/pix/circle.rb +73 -0
  70. data/ruby_libs/pav/pix/contour/CVS/Entries +5 -0
  71. data/ruby_libs/pav/pix/contour/CVS/Repository +1 -0
  72. data/ruby_libs/pav/pix/contour/CVS/Root +1 -0
  73. data/ruby_libs/pav/pix/contour/calc_situations.rb +9 -0
  74. data/ruby_libs/pav/pix/contour/carp_calc.rb +212 -0
  75. data/ruby_libs/pav/pix/contour/situations.dmp +0 -0
  76. data/ruby_libs/pav/pix/contour/situations.rb +21 -0
  77. data/ruby_libs/pav/pix/contour.rb +644 -0
  78. data/ruby_libs/pav/pix/curve.rb +1508 -0
  79. data/ruby_libs/pav/pix/img_obj.rb +751 -0
  80. data/ruby_libs/pav/pix/node.rb +712 -0
  81. data/ruby_libs/pav/pix/node_grp.rb +853 -0
  82. data/ruby_libs/pav/pix/shaved_core.rb +534 -0
  83. data/ruby_libs/pav/pix/subpix.rb +212 -0
  84. data/ruby_libs/pav/pix.rb +402 -0
  85. data/ruby_libs/pav/rand_accessible.rb +16 -0
  86. data/ruby_libs/pav/rangeset.rb +63 -0
  87. data/ruby_libs/pav/search.rb +210 -0
  88. data/ruby_libs/pav/set.rb +20 -0
  89. data/ruby_libs/pav/string/CVS/Entries +6 -0
  90. data/ruby_libs/pav/string/CVS/Repository +1 -0
  91. data/ruby_libs/pav/string/CVS/Root +1 -0
  92. data/ruby_libs/pav/string/bits.rb +523 -0
  93. data/ruby_libs/pav/string/ext.rb +58 -0
  94. data/ruby_libs/pav/string/observable.rb +155 -0
  95. data/ruby_libs/pav/string/text.rb +79 -0
  96. data/ruby_libs/pav/string/words.rb +42 -0
  97. data/ruby_libs/pav/sub_arr.rb +55 -0
  98. data/ruby_libs/pav/traced_obj.rb +79 -0
  99. metadata +147 -0
@@ -0,0 +1,210 @@
1
+ require 'pav/heap'
2
+
3
+ module PSearch
4
+
5
+ def self.bsearch(arr, lm, start_i=0, end_i=nil) # &block = optional comparator
6
+ end_i = arr.length-1 if !end_i
7
+ if block_given?
8
+ while start_i < end_i
9
+ mid_i = (end_i + start_i) / 2
10
+ if (leg = yield(arr[mid_i], lm)) > 0
11
+ end_i = mid_i-1
12
+ elsif leg < 0
13
+ start_i = mid_i+1
14
+ else
15
+ return mid_i
16
+ end
17
+ end
18
+ if start_i == end_i
19
+ if (leg = yield(arr[start_i], lm)) == 0
20
+ return start_i
21
+ elsif leg > 0
22
+ return -start_i-1
23
+ else
24
+ return -start_i-2
25
+ end
26
+ end
27
+ else
28
+ while start_i < end_i
29
+ mid_i = (end_i + start_i) / 2
30
+ if (val = arr[mid_i]) > lm
31
+ end_i = mid_i-1
32
+ elsif val < lm
33
+ start_i = mid_i+1
34
+ else
35
+ return mid_i
36
+ end
37
+ end
38
+ if start_i == end_i
39
+ if arr[start_i] == lm
40
+ return start_i
41
+ elsif arr[start_i] > lm
42
+ return -start_i-1
43
+ else
44
+ return -start_i-2
45
+ end
46
+ end
47
+ end
48
+ -start_i-1
49
+ end
50
+
51
+ def self.path_cache_get_path(path_cache, start_pos, pos, get_pos_id_proc=nil)
52
+ #$PDbgLog.sig_call(self)
53
+ #$PDbgLog.print_msg "start_pos=#{start_pos}, pos=#{pos}: "
54
+ # $PDbgLog.print_msg "path_cache: #{path_cache.keys.sort.collect{|k|
55
+ # k.inspect+'=>[' + path_cache[k].join(', ') + ']'}.join('; ')}: "
56
+ res = []
57
+ if get_pos_id_proc
58
+ pos, to_link = *path_cache[get_pos_id_proc.call(pos)]
59
+ return res unless to_link
60
+ start_pos_id = get_pos_id_proc.call(start_pos)
61
+ while to_link
62
+ res << to_link
63
+ break if get_pos_id_proc.call(pos) == start_pos_id
64
+ pos, to_link = *path_cache[get_pos_id_proc.call(pos)]
65
+ end
66
+ else
67
+ pos, to_link = *path_cache[pos]
68
+ return res unless pos
69
+ while to_link
70
+ res << to_link
71
+ break if pos == start_pos
72
+ pos, to_link = *path_cache[pos]
73
+ end
74
+ end
75
+ #$PDbgLog.sig_return(res.join(' '))
76
+ res
77
+ end
78
+
79
+ # Wave (breadth) / Dijkstra search:
80
+ def self.first_loop(start_pos, dest_proc, max_lev=1.0/0.0, get_pos_id_proc=nil)
81
+ # &get_neighb_posns
82
+ #$PDbgLog.sig_call(self)
83
+ path_cache={}
84
+ tail = PMinHeap.new { |frm1,frm2| frm1[1] <=> frm2[1] }
85
+ if get_pos_id_proc
86
+ yield(start_pos, 0).each { |args| neighb, to_link, neighb_lev = *args
87
+ unless (path_cache.include?(get_pos_id_proc.call(neighb)) &&
88
+ path_cache[get_pos_id_proc.call(neighb)][2] <= neighb_lev) ||
89
+ neighb_lev > max_lev
90
+ tail.push([neighb, neighb_lev])
91
+ path_cache[get_pos_id_proc.call(neighb)] =
92
+ [start_pos, to_link, neighb_lev]
93
+ end
94
+ }
95
+ while !tail.empty?
96
+ #$PDbgLog.puts_msg "tail: " + tail.collect { |frm|
97
+ # (frm[0] ? frm[0].coords_to_s : frm[0].inspect) +
98
+ # ":#{frm[1]}" }.join(" ")
99
+ pos, lev = *tail.pop
100
+ next if (tmp=path_cache[get_pos_id_proc.call(pos)])&& tmp[2]<lev
101
+ if dest_proc.call(pos, lev)
102
+ (res = self.path_cache_get_path(path_cache, start_pos,
103
+ pos, get_pos_id_proc)).reverse!
104
+ #$PDbgLog.sig_return
105
+ return res
106
+ end
107
+ yield(pos, lev).each { |args| neighb, to_link,neighb_lev = *args
108
+ unless ((tmp=path_cache[get_pos_id_proc.call(neighb)])&&
109
+ tmp[2] <= neighb_lev) || neighb_lev > max_lev
110
+ tail.push([neighb, neighb_lev])
111
+ path_cache[get_pos_id_proc.call(neighb)] =
112
+ [pos, to_link, neighb_lev]
113
+ end
114
+ }
115
+ end
116
+ #$PDbgLog.sig_return("nil")
117
+ nil
118
+ else
119
+ yield(start_pos, 0).each { |args| neighb, to_link, neighb_lev = *args
120
+ unless (path_cache.include?(neighb) &&
121
+ path_cache[neighb][2] <= neighb_lev) || neighb_lev > max_lev
122
+ tail.push([neighb, neighb_lev])
123
+ path_cache[neighb] = [start_pos, to_link, neighb_lev]
124
+ end
125
+ }
126
+ while !tail.empty?
127
+ #$PDbgLog.puts_msg "tail: " + tail.collect { |frm|
128
+ # (frm[0] ? frm[0].coords_to_s : frm[0].inspect) +
129
+ # ":#{frm[1]}" }.join(" ")
130
+ pos, lev = *tail.pop
131
+ next if path_cache.include?(pos) && path_cache[pos][2] < lev
132
+ if dest_proc.call(pos, lev)
133
+ (res = self.path_cache_get_path(path_cache, start_pos,
134
+ pos)).reverse!
135
+ #$PDbgLog.sig_return
136
+ return res
137
+ end
138
+ yield(pos, lev).each { |args| neighb, to_link,neighb_lev = *args
139
+ unless (path_cache.include?(neighb) &&
140
+ path_cache[neighb][2] <= neighb_lev) ||
141
+ neighb_lev > max_lev
142
+ tail.push([neighb, neighb_lev])
143
+ path_cache[neighb] = [pos, to_link, neighb_lev]
144
+ end
145
+ }
146
+ end
147
+ #$PDbgLog.sig_return("nil")
148
+ nil
149
+ end
150
+ end
151
+
152
+ # Find a loop which functions without a repetition of a connection in the
153
+ # _undirected_ graph of positions.
154
+ def self.first_norep_loop(start_pos, max_lev=1.0/0.0, max_len=1.0/0.0,
155
+ get_pos_id_proc=nil) # &get_neighb_posns
156
+ #$PDbgLog.sig_call(self)
157
+ tail = PMinHeap.new { |frm1,frm2| frm1[1] <=> frm2[1] }
158
+ get_pos_id_proc = proc { |a| a } unless get_pos_id_proc
159
+ start_pos_id = get_pos_id_proc.call(start_pos)
160
+ path_cache = {start_pos_id => [nil, nil, 0, -1]}
161
+ sol = nil
162
+ yield(start_pos, 0).each_with_index { |args, thr_i|
163
+ neighb, to_link, neighb_lev = *args
164
+ next if neighb_lev > max_lev
165
+ if (tmp=path_cache[get_pos_id_proc.call(neighb)])
166
+ len = tmp[2] + neighb_lev
167
+ if (!sol || sol[3] > len) && len <= max_len
168
+ sol = [neighb, start_pos, to_link, len]
169
+ end
170
+ else
171
+ tail.push([neighb, neighb_lev, thr_i])
172
+ path_cache[get_pos_id_proc.call(neighb)] =
173
+ [start_pos, to_link, neighb_lev, thr_i]
174
+ end
175
+ }
176
+ loop do
177
+ if sol
178
+ p1 = self.path_cache_get_path(path_cache, start_pos,
179
+ sol[0], get_pos_id_proc)
180
+ path_cache[get_pos_id_proc.call(sol[0])] = [sol[1],
181
+ sol[2]]
182
+ #$PDbgLog.sig_return
183
+ return [p1, self.path_cache_get_path(path_cache,
184
+ start_pos, sol[0], get_pos_id_proc), sol[3]]
185
+ end
186
+ if tail.empty?
187
+ #$PDbgLog.sig_return("nil")
188
+ return nil
189
+ end
190
+ pos, lev, thr_i = *tail.pop
191
+ next if (tmp=path_cache[get_pos_id_proc.call(pos)]) &&tmp[2]<lev
192
+ yield(pos, lev).each { |args| neighb, to_link,neighb_lev = *args
193
+ next if neighb_lev > max_lev ||
194
+ get_pos_id_proc.call(neighb) == start_pos_id
195
+ if (tmp=path_cache[get_pos_id_proc.call(neighb)]) &&
196
+ tmp[3] != thr_i
197
+ if (len=tmp[2] + neighb_lev) <= max_len &&
198
+ (!sol || sol[3] > len)
199
+ sol = [neighb, pos, to_link, len]
200
+ end
201
+ elsif !tmp || tmp[2] > neighb_lev
202
+ tail.push([neighb, neighb_lev, thr_i])
203
+ path_cache[get_pos_id_proc.call(neighb)] =
204
+ [pos, to_link, neighb_lev, thr_i]
205
+ end
206
+ }
207
+ end
208
+ end
209
+
210
+ end
@@ -0,0 +1,20 @@
1
+ require 'pav/search'
2
+
3
+ class SortedArrSet
4
+ attr_reader :arr, :comparator
5
+
6
+ def initialize(arr, &comparator)
7
+ @arr = arr
8
+ @comparator = comparator
9
+ end
10
+
11
+ def include?(m)
12
+ PSearch.bsearch(@arr, m, &@comparator) >= 0
13
+ end
14
+
15
+ alias_method :member?, :include?
16
+
17
+ def method_missing(id, *args, &block)
18
+ @arr.send(id, *args, &block)
19
+ end
20
+ end
@@ -0,0 +1,6 @@
1
+ /bits.rb/1.1.1.1/Tue Nov 15 17:32:41 2005//
2
+ /ext.rb/1.1.1.1/Tue Nov 15 17:32:40 2005//
3
+ /observable.rb/1.1.1.1/Tue Nov 15 17:32:41 2005//
4
+ /text.rb/1.1.1.1/Tue Nov 15 17:32:41 2005//
5
+ /words.rb/1.1.1.1/Tue Nov 15 17:32:40 2005//
6
+ D
@@ -0,0 +1 @@
1
+ extract-curves/ruby_libs/pav/string
@@ -0,0 +1 @@
1
+ :ext:pavpen@rubyforge.org:/var/cvs/extract-curves