atome 0.5.7.3.6 → 0.5.7.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1 -1
  3. data/documentation/deep learning/architecture.txt +4 -4
  4. data/documentation/deep learning/basic_infos.txt +2 -2
  5. data/documentation/deep learning/example_of_users_code.rb +43 -43
  6. data/documentation/installation/buiding_atome.md +2 -2
  7. data/lib/atome/atome.rb +24 -56
  8. data/lib/atome/extensions/atome.rb +31 -77
  9. data/lib/atome/extensions/sha.rb +7 -7
  10. data/lib/atome/genesis/atomes.rb +1 -1
  11. data/lib/atome/genesis/genesis.rb +6 -95
  12. data/lib/atome/genesis/particles/communication.rb +1 -1
  13. data/lib/atome/genesis/particles/event.rb +0 -8
  14. data/lib/atome/genesis/particles/geometry.rb +3 -4
  15. data/lib/atome/genesis/particles/hierarchy.rb +28 -27
  16. data/lib/atome/genesis/particles/identity.rb +0 -30
  17. data/lib/atome/genesis/particles/material.rb +13 -12
  18. data/lib/atome/genesis/particles/property.rb +41 -16
  19. data/lib/atome/genesis/particles/security.rb +0 -45
  20. data/lib/atome/genesis/particles/utility.rb +77 -137
  21. data/lib/atome/genesis/sparkle.rb +3 -12
  22. data/lib/atome/kernel/black_matter.rb +2 -0
  23. data/lib/atome/kernel/universe.rb +5 -45
  24. data/lib/atome/presets/atome.rb +0 -22
  25. data/lib/atome/utilities/utilities.rb +19 -8
  26. data/lib/atome/version.rb +2 -1
  27. data/lib/molecules/init.rb +0 -14
  28. data/lib/molecules/intuition/tools.rb +24 -43
  29. data/lib/molecules/intuition/utilities.rb +261 -135
  30. data/lib/platform_specific/opal/atome_opal_extensions.rb +0 -1
  31. data/lib/platform_specific/opal/extensions/color.rb +0 -5
  32. data/lib/platform_specific/opal/extensions/geolocation.rb +5 -5
  33. data/lib/platform_specific/opal/extensions/object.rb +1 -1
  34. data/lib/platform_specific/opal/extensions/ping.rb +11 -20
  35. data/lib/renderers/html/effect.rb +0 -11
  36. data/lib/renderers/html/event.rb +0 -7
  37. data/lib/renderers/html/geometry.rb +0 -31
  38. data/lib/renderers/html/html.rb +32 -128
  39. data/lib/renderers/html/material.rb +0 -22
  40. data/lib/renderers/html/spatial.rb +0 -9
  41. data/lib/renderers/html/utility.rb +5 -8
  42. data/lib/renderers/renderer.rb +0 -1
  43. data/vendor/assets/application/examples/account.rb +35 -0
  44. data/vendor/assets/application/examples/actor&role.rb +23 -0
  45. data/vendor/assets/application/examples/animation.rb +1 -1
  46. data/vendor/assets/application/examples/applications.rb +26 -77
  47. data/vendor/assets/application/examples/atome.rb +1 -1
  48. data/vendor/assets/application/examples/attach.rb +7 -7
  49. data/vendor/assets/application/examples/attached.rb +13 -15
  50. data/vendor/assets/application/examples/basic_understanding.rb +1 -1
  51. data/vendor/assets/application/examples/buttons.rb +48 -0
  52. data/vendor/assets/application/examples/clear.rb +12 -12
  53. data/vendor/assets/application/examples/clones&monitoring.rb +1 -1
  54. data/vendor/assets/application/examples/delete.rb +19 -14
  55. data/vendor/assets/application/examples/detach.rb +8 -0
  56. data/vendor/assets/application/examples/dig.rb +1 -1
  57. data/vendor/assets/application/examples/display.rb +6 -6
  58. data/vendor/assets/application/examples/drag.rb +1 -1
  59. data/vendor/assets/application/examples/duplicate.rb +6 -6
  60. data/vendor/assets/application/examples/exchange.rb +17 -0
  61. data/vendor/assets/application/examples/generator_and_build.rb +3 -3
  62. data/vendor/assets/application/examples/hierarchy.rb +5 -5
  63. data/vendor/assets/application/examples/layout.rb +1 -1
  64. data/vendor/assets/application/examples/preset.rb +3 -3
  65. data/vendor/assets/application/examples/selected.rb +1 -1
  66. data/vendor/assets/application/examples/shapes.rb +1 -1
  67. data/vendor/assets/application/examples/size.rb +1 -1
  68. data/vendor/assets/application/examples/test.rb +0 -320
  69. data/vendor/assets/application/examples/tools.rb +136 -192
  70. data/vendor/assets/application/examples/unfasten.rb +23 -0
  71. data/vendor/assets/application/index.rb +1 -1
  72. data/vendor/assets/server/atome_server.rb +1 -0
  73. data/vendor/assets/server/capture.rb +0 -1
  74. data/vendor/assets/server/database.rb +0 -1
  75. data/vendor/assets/server/eDen.rb +16 -94
  76. data/vendor/assets/src/index_server_wasm.html +1 -0
  77. data/vendor/assets/src/index_wasm.html +0 -6
  78. data/vendor/assets/src/js/atome/specific/wasm.js +22 -4
  79. data/vendor/assets/src/js/third_parties/three.min.js +1 -1
  80. data/vendor/assets/src/medias/fonts/Roboto/LICENSE.txt +1 -1
  81. data/vendor/assets/src/medias/fonts/Roboto_Slab/LICENSE.txt +1 -1
  82. metadata +8 -6
  83. data/lib/molecules/_deprecated_examples/site.rb +0 -34
  84. data/lib/molecules/intuition/_deprecated_inputs.rb +0 -111
  85. data/lib/molecules/intuition/_deprecated_toolbox.rb +0 -282
  86. data/lib/platform_specific/opal/extensions/sha.rb +0 -25
@@ -23,32 +23,24 @@ class Universe
23
23
  @allow_sync = false # temp server storage sync
24
24
  @connected = false
25
25
  @database_ready = false
26
- @tools_root=[]
26
+ @tools_root = []
27
27
  @tools = {}
28
28
  @allow_tool_operations = false
29
29
  @active_tools = []
30
30
  @atome_preset = []
31
- @default_selection_style={border: { thickness: 1, red: 1, green: 0, blue: 0, alpha: 1, pattern: :dotted }}
32
- @applicable_atomes= %i[color shadow border paint animation]
31
+ @default_selection_style = { border: { thickness: 1, red: 1, green: 0, blue: 0, alpha: 1, pattern: :dotted } }
32
+ @applicable_atomes = %i[color shadow border paint animation]
33
33
  # @historicize=false
34
34
  class << self
35
35
  attr_reader :atomes, :atomes_ids, :renderer_list, :molecule_list, :atome_list, :particle_list, :classes, :counter,
36
36
  :atomes_specificities
37
- attr_accessor :connected, :allow_sync, :allow_localstorage, :database_ready, :edit_mode, :tools,:tools_root,
37
+ attr_accessor :connected, :allow_sync, :allow_localstorage, :database_ready, :edit_mode, :tools, :tools_root,
38
38
  :allow_tool_operations, :active_tools, :atome_preset, :applicable_atomes, :default_selection_style
39
39
 
40
40
  def messages
41
41
  @messages
42
42
  end
43
43
 
44
- # def eVe(val = nil)
45
- # if val
46
- # @eve = val
47
- # else
48
- # @eve
49
- # end
50
- # end
51
-
52
44
  def store_messages(new_msg)
53
45
  @messages[new_msg[:msg_nb]] = new_msg[:proc]
54
46
  end
@@ -98,13 +90,11 @@ class Universe
98
90
 
99
91
  def add_sanitizer_method(method_name, &method_proc)
100
92
  # this method is used to add sanitizer methods
101
- # instance_variable_get('@sanitizers').merge!({ method_name => method_proc })
102
93
  @sanitizers.merge!({ method_name => method_proc })
103
94
  end
104
95
 
105
96
  def get_sanitizer_method(method_name)
106
97
  # this method is used to add optional methods
107
- # instance_variable_get('@sanitizers')[method_name]
108
98
  @sanitizers[method_name]
109
99
  end
110
100
 
@@ -125,21 +115,10 @@ class Universe
125
115
  @atomes_ids[id] = aid
126
116
  end
127
117
 
128
- # def update_atome_id(aid, atome, prev_id)
129
- # @atomes[id] = atome
130
- # @atomes.delete(prev_id)
131
- # end
132
- # def update_atome_id(id, atome, prev_id)
133
- # @atomes[id] = atome
134
- # @atomes.delete(prev_id)
135
- # end
136
-
137
118
  def user_atomes
138
119
  collected_id = []
139
- @atomes.each do |id_found, atome_found|
140
- # collected_id << id_found unless atome_found.tag && atome_found.tag[:system]
120
+ @atomes.each_value do |atome_found|
141
121
  collected_id << atome_found.id unless atome_found.tag && atome_found.tag[:system]
142
-
143
122
  end
144
123
  collected_id
145
124
  end
@@ -217,7 +196,6 @@ class Universe
217
196
  end
218
197
 
219
198
  def current_server
220
- # return unless RUBY_ENGINE.downcase == 'opal'
221
199
  JS.global[:location][:href].to_s
222
200
  end
223
201
 
@@ -275,34 +253,16 @@ class Universe
275
253
  operation_timing = Time.now.strftime("%Y%m%d%H%M%S%3N") + @increment.to_s
276
254
  @increment += 1
277
255
  @increment = @increment % 100
278
- # puts "===> { #{id} => { #{operation} => { #{element} => #{params} } }, sync: false }"
279
- # puts "<==== #{@allow_localstorage} : #{element} ====>"
280
256
  if @allow_localstorage.include? element
281
257
  JS.global[:localStorage].setItem(operation_timing, "{ #{id} => { #{operation} => { #{element} => #{params} } }, sync: false }")
282
258
  @history[@history.length] = { operation_timing => { id => { operation => { element => params } }, sync: false, time: Time.now } }
283
- # puts "===> { #{id} => { #{operation} => { #{element} => #{params} } }, sync: false }"
284
259
  end
285
260
 
286
-
287
261
  end
288
262
  end
289
263
 
290
264
  def story
291
265
  @history
292
- # # temp algo awaiting db to be ready, just for POC and tests
293
- # return unless filter
294
- #
295
- # operation = filter[:operation]
296
- # atome_id = filter[:id]
297
- # particle = filter[:particle]
298
- # filtered_history = []
299
- # @history.each do |operation_number, alteration|
300
- # if alteration[atome_id] && (alteration[atome_id][operation]) && (alteration[atome_id][operation][particle])
301
- # filtered_history << { operation: operation_number, filter[:particle] => alteration[atome_id][operation][particle], sync: alteration[:sync], time: alteration[:time] }
302
- # end
303
- # end
304
- # filtered_history
305
266
  end
306
-
307
267
  end
308
268
  end
@@ -13,15 +13,10 @@ class Atome
13
13
  # TODO : remove Essentials.default_params[atome_preset] || {} as it is
14
14
  # applied twice because preset is now a particle
15
15
  preset_params = Essentials.default_params[atome_preset] || {}
16
- # preset_params = {preset: atome_preset}
17
16
  basic_params[:type] = preset_params[:type] || :element
18
- # basic_params[:aid] = identity_generator(:a)
19
- # alert "common => #{params[:id]}"
20
- # alert "basic_params #{basic_params[:id].class}"
21
17
  basic_params[:id] = params[:id] || identity_generator
22
18
  basic_params[:renderers] = @renderers || preset_params[:renderers]
23
19
  essential_params = basic_params.merge(preset_params)
24
- #
25
20
  reordered_params = essential_params.reject { |key, _| params.has_key?(key) }
26
21
  params = reordered_params.merge(params)
27
22
  params[:id] = params[:id].to_sym
@@ -45,23 +40,6 @@ class Atome
45
40
  Atome.new(params, &bloc)
46
41
  end
47
42
 
48
- # def box(params = {}, &bloc)
49
- # atome_preset = :box
50
- # params = atome_common(atome_preset, params)
51
- # preset_common(params, &bloc)
52
- # end
53
- #
54
- # # def intuition(params = {}, &bloc)
55
- # # atome_preset = :intuition
56
- # # params = atome_common(atome_preset, params)
57
- # # preset_common(params, &bloc)
58
- # # end
59
- #
60
- # def circle(params = {}, &bloc)
61
- # atome_preset = :circle
62
- # params = atome_common(atome_preset, params)
63
- # preset_common(params, &bloc)
64
- # end
65
43
  end
66
44
 
67
45
 
@@ -327,7 +327,7 @@ class Atome
327
327
  Atome.define_method("#{element}_callback") do |return_params|
328
328
  # we test if instance_variable_get("@#{element}_code") is a hash for the can se the particle value is a hash
329
329
  proc_found = if instance_variable_get("@#{element}_code").instance_of? Hash
330
- # Then we get the first item of the hash because the proc is attached to it
330
+ # Then we get the first item of the hash because the proc is fasten to it
331
331
  instance_variable_get("@#{element}_code").values.first
332
332
  # instance_exec(@callback[element], proc_found)if proc_found.is_a? Proc
333
333
  else
@@ -430,11 +430,12 @@ class Atome
430
430
  end
431
431
  end
432
432
 
433
- def detach_atome(atome_id_to_detach)
434
- atome_to_detach = grab(atome_id_to_detach)
435
- # TODO: remove the condition below and find why it try to detach an atome that doesn't exist
436
- nil unless atome_to_detach
437
- end
433
+ # def detach_atome(atome_id_to_detach)
434
+ # alert :uuu
435
+ # atome_to_detach = grab(atome_id_to_detach)
436
+ # # TODO: remove the condition below and find why it try to detach an atome that doesn't exist
437
+ # nil unless atome_to_detach
438
+ # end
438
439
 
439
440
  def debug(msg)
440
441
  puts msg
@@ -459,8 +460,8 @@ class Atome
459
460
  remove({ category: attach })
460
461
  category(:atome)
461
462
  attach(grand_parent)
462
- # we delete the parent (the layout) if it no more children attached
463
- if parent_found.attached.length == 0
463
+ # we delete the parent (the layout) if it no more children fasten
464
+ if parent_found.fasten.length == 0
464
465
  parent_found.delete(true)
465
466
  end
466
467
  end
@@ -503,12 +504,22 @@ class Atome
503
504
  # puts "sanitizer temp patch when an atome is passed instead of an id"
504
505
  # @id
505
506
  # end
507
+ # def transform_to_string_keys_and_values(hash)
508
+ # hash.transform_keys(&:to_s).transform_values do |value|
509
+ # if value.is_a?(Hash)
510
+ # transform_to_string_keys_and_values(value)
511
+ # else
512
+ # value.to_s
513
+ # end
514
+ # end
515
+ # end
506
516
 
507
517
  def sync(params, &bloc)
508
518
  params = { data: params } unless params.instance_of? Hash
509
519
  message_id = "msg_#{Universe.messages.length}"
510
520
  params[:message_id] = message_id
511
521
  Universe.store_messages({ msg_nb: message_id, proc: bloc })
522
+ # params = transform_to_string_keys_and_values(params)
512
523
  html.send_message(params)
513
524
  end
514
525
 
data/lib/atome/version.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # return atome version
4
+
4
5
  class Atome
5
- VERSION = '0.5.7.3.6'
6
+ VERSION = '0.5.7.4.2'
6
7
  end
@@ -6,10 +6,6 @@ end
6
6
 
7
7
  class Object
8
8
  include Molecule
9
- # we add a getter for the molecule in standard ruby Object
10
- # def molecule
11
- # @molecule
12
- # end
13
9
  end
14
10
 
15
11
  class Atome
@@ -17,15 +13,5 @@ class Atome
17
13
  end
18
14
 
19
15
 
20
- # tests
21
- # new({application: :compose, header: true, footer: true })
22
- #
23
- # new(page: {name: :home, application: :compose, attach: :root })
24
- #
25
- # new(module: {name: :home, application: :compose, attach: :root })
26
-
27
-
28
-
29
-
30
16
 
31
17
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  def truncate_string(string, max_length)
4
- string.length > max_length ? string.slice(0, max_length) + "." : string
4
+ string.length > max_length ? string.slice(0, max_length) + '.' : string
5
5
  end
6
6
 
7
7
  size = 33
@@ -53,7 +53,7 @@ class Atome
53
53
  def activate_click_analysis
54
54
  # the condition below avoid touchdown analysis accumulation
55
55
  unless @click_analysis_active
56
- # this method analyse all object under the touchdown to find the first user objet and return it's id
56
+ # this method analyse all object under the touchdown to find the first user object and return it's id
57
57
  @click_analysis = lambda { |native_event|
58
58
  # the instance variable below check if we can apply tool (cf: if the atome we don't want to apply tool)
59
59
  if Universe.allow_tool_operations
@@ -66,10 +66,9 @@ class Atome
66
66
  id_found = atome_touched[:id].to_s
67
67
  atome_found = grab(id_found)
68
68
  # unless (atome_found && atome_found.tag[:system])
69
- if atome_found && !atome_found.tag[:system]
70
- Universe.active_tools.each do |tool|
71
- apply_tool(tool, atome_found, event)
72
- end
69
+ puts 'we have to check if operation is a creation or an alteration to include or exclude the view '
70
+ Universe.active_tools.each do |tool|
71
+ apply_tool(tool, atome_found, event)
73
72
  end
74
73
 
75
74
  break
@@ -90,6 +89,7 @@ class Atome
90
89
  end
91
90
 
92
91
  def start_click_analysis
92
+ # here we capture any touch when usingh tool
93
93
  @click_analysis_active = false
94
94
  JS.global[:document].addEventListener('mouseup') do |native_event|
95
95
  Atome.instance_exec(native_event, &@click_analysis) if @click_analysis.is_a?(Proc)
@@ -120,11 +120,9 @@ class Atome
120
120
  end
121
121
 
122
122
  def creation(current_tool, tool_actions, atome_touched, a_event)
123
- # we store prev_local_storage prior to lock it to prevent unwanted logs
124
- # prev_local_storage=Universe.allow_localstorage()
123
+ @creation_mode = true
125
124
  storage_allowed = Universe.allow_localstorage
126
125
  Universe.allow_localstorage = false
127
-
128
126
  action_found = tool_actions[:action]
129
127
  pre = tool_actions[:pre]
130
128
  post = tool_actions[:post]
@@ -140,7 +138,6 @@ class Atome
140
138
  else
141
139
  grab(:view).send(atome, temp_val)
142
140
  end
143
- # current_tool.data[:treated] << new_atome
144
141
  current_tool.data[:created] << new_atome
145
142
  params.delete(:atome_touched)
146
143
  params[new_atome: new_atome]
@@ -155,6 +152,7 @@ class Atome
155
152
  end
156
153
 
157
154
  def apply_tool(tool, atome_touched, a_event)
155
+
158
156
  current_tool = grab(tool)
159
157
  tool_actions = current_tool.data
160
158
  method_found = tool_actions[:method]
@@ -165,18 +163,20 @@ class Atome
165
163
  end
166
164
  tool_name = tool.to_s.sub('_tool', '')
167
165
  tools_scheme = Universe.tools[tool_name.to_sym]
168
- puts "1 - here slider treat either the target atome types or current atome"
169
- puts "2 - need to created a list instead of choosing the last atome found of it's kind"
170
166
 
171
167
  target = if tools_scheme[:target]
172
168
  grab(atome_touched.send(tools_scheme[:target]).last)
173
169
  else
174
170
  atome_touched
175
171
  end
176
- tools_scheme[:particles]&.each do |particle_f, value_f|
177
- target.send(particle_f, value_f)
172
+ unless method_found == :alteration && target.tag[:system]
173
+
174
+ tools_scheme[:particles]&.each do |particle_f, value_f|
175
+ target.send(particle_f, value_f)
176
+ end
177
+ send(method_found, current_tool, tool_actions, target, a_event)
178
178
  end
179
- send(method_found, current_tool, tool_actions, target, a_event)
179
+
180
180
  end
181
181
 
182
182
  end
@@ -213,7 +213,6 @@ class Atome
213
213
  tool.data[:created] = []
214
214
  tool.data[:prev_states] = {}
215
215
  # generic behavior
216
- # tool.apply(:active_tool_col)
217
216
  grab("#{tool_name}_icon").color(:white)
218
217
  grab("#{tool_name}_label").color(:white)
219
218
  Universe.active_tools << tool_name
@@ -244,8 +243,7 @@ class Atome
244
243
  Atome.apply_tool(tool_name, atome_found, event)
245
244
  end
246
245
  end
247
-
248
- # # activate tool analysis test
246
+ # activate tool analysis test
249
247
  Atome.activate_click_analysis
250
248
  tool.active(true)
251
249
  end
@@ -255,10 +253,10 @@ class Atome
255
253
  tool_scheme = @tool_scheme
256
254
  tool = self
257
255
  tool.active(false)
258
- tool.instance_variable_get("@toolbox")&.each do |sub_tool_id|
256
+ tool.instance_variable_get('@toolbox')&.each do |sub_tool_id|
259
257
  toolbox_tool = grab("#{sub_tool_id}_tool")
260
258
  toolbox_tool.deactivate_tool
261
- # we delete the attached toolbox if it exist
259
+ # we delete the fasten toolbox if it exist
262
260
  toolbox_tool.delete({ force: true })
263
261
  end
264
262
  grab("#{tool_name}_icon").color(grab(:toolbox_style).data[:text_color])
@@ -291,7 +289,6 @@ class Atome
291
289
  tool_name = "#{params[:name]}_tool"
292
290
  index = params[:index]
293
291
  tool_scheme = params[:scheme]
294
- # @tool_scheme=params[:scheme]
295
292
  toolbox = params[:toolbox] || {}
296
293
  orientation_wanted = tool_scheme[:orientation] || :sn
297
294
 
@@ -343,16 +340,14 @@ class Atome
343
340
  action: action,
344
341
  allow_alteration: true,
345
342
  allow_creation: true,
346
- # activation: tool_scheme[:activation],
347
- # inactivation: tool_scheme[:inactivation], zone: tool_scheme[:zone],
348
343
  post: tool_scheme[:post],
349
344
  pre: tool_scheme[:pre],
350
345
  }
351
346
 
352
347
  })
353
348
 
354
- tool.instance_variable_set("@tool_scheme", tool_scheme)
355
- edition = "M257.7 752c2 0 4-0.2 6-0.5L431.9 722c2-0.4 3.9-1.3 5.3-2.8l423.9-423.9c3.9-3.9 3.9-10.2 0-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2c-1.9 11.1 1.5 21.9 9.4 29.8 6.6 6.4 14.9 9.9 23.8 9.9z m67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"
349
+ tool.instance_variable_set('@tool_scheme', tool_scheme)
350
+ edition = 'M257.7 752c2 0 4-0.2 6-0.5L431.9 722c2-0.4 3.9-1.3 5.3-2.8l423.9-423.9c3.9-3.9 3.9-10.2 0-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2c-1.9 11.1 1.5 21.9 9.4 29.8 6.6 6.4 14.9 9.9 23.8 9.9z m67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z'
356
351
  icon = tool.vector({ tag: { system: true }, left: 9, top: :auto, bottom: 9, width: 18, height: 18, id: "#{tool_name}_icon",
357
352
  data: { path: { d: edition, id: "p1_#{tool_name}_icon", stroke: :black, 'stroke-width' => 37, fill: :white } } })
358
353
 
@@ -368,14 +363,14 @@ class Atome
368
363
  tool.instance_variable_set('@prevent_action', true)
369
364
  if tool.instance_variable_get('@tool_open') == true
370
365
  tool.instance_variable_set('@tool_open', false)
371
- tool_scheme[:particles].each do |particle, value|
366
+ tool_scheme[:particles].each_key do |particle|
372
367
  grab("tool_particle_#{particle}").delete({ force: true })
373
368
  end
374
369
  tool.width(size)
375
370
  else
376
371
  tool.instance_variable_set('@tool_open', true)
377
372
 
378
- tool_scheme[:particles].each_with_index do |(particle_name, _value_), ind|
373
+ tool_scheme[:particles]&.each_with_index do |(particle_name, _value_), ind|
379
374
 
380
375
  particle = tool.box({ id: "tool_particle_#{particle_name}", tag: { system: true }, depth: 1, smooth: smooth,
381
376
  apply: %i[inactive_tool_col tool_box_border tool_shade],
@@ -413,16 +408,11 @@ class Atome
413
408
  if particle.instance_variable_get('@active')
414
409
  grab(slider_id).delete({ force: true })
415
410
  particle.instance_variable_set('@active', false)
416
- # particle.top(:auto)
417
- # particle.top(:bottom)
418
411
  particle.height(size)
419
412
  particle.top(0)
420
413
  else
421
414
  particle.height(139 + size / 2)
422
415
  particle.top(-139 + size)
423
- # particle.top(:auto)
424
- # particle.top(:bottom)
425
- # particle.color(:green)
426
416
  slider_id = "particle_slider_#{particle_name}"
427
417
  slider_f = particle.slider({ orientation: :vertical,
428
418
  id: slider_id,
@@ -441,23 +431,19 @@ class Atome
441
431
  if grab(slider_id).instance_variable_get('@initialised')
442
432
  Atome.selection.each do |atome_id_to_treat|
443
433
 
444
- # puts "-------> #{tool_scheme[:particles][particle_name]} , #{value }"
445
434
  tool_scheme[:particles][particle_name] = value.to_f / 100
446
- # tools_scheme[:particles]
447
435
  atome_found = grab(atome_id_to_treat)
448
436
  target = grab(atome_found.color.last)
449
437
 
450
438
  target.send(particle_name, value.to_f / 100)
451
439
  label_value.data(value.to_f / 100)
452
- # puts "+++++++> #{tool_scheme[:particles]} }"
453
440
  end
454
441
  end
455
442
  end
456
- puts "2 ======> opening !!!#{particle_name}"
457
443
 
458
444
  Atome.selection.each do |atome_id_to_treat|
459
445
  atome_found = grab(atome_id_to_treat)
460
- puts "here slider treat either the target atome types or current atome"
446
+ puts 'here slider treat either the target atome types or current atome'
461
447
  puts "need to created a list instead of choosing the last atome found of it's kind"
462
448
  target = if tool_scheme[:target]
463
449
  grab(atome_found.send(tool_scheme[:target]).last)
@@ -472,8 +458,7 @@ class Atome
472
458
  end
473
459
 
474
460
  end
475
- end if tool_scheme[:particles]
476
- # tool.width(((size + margin) * (tool_scheme[:particles].length + 1)))
461
+ end
477
462
  end
478
463
 
479
464
  end
@@ -481,8 +466,6 @@ class Atome
481
466
  tool.depth(999)
482
467
  end
483
468
  tool.touch(true) do
484
-
485
- # puts "==> prevent : #{tool.instance_variable_get('@prevent_action')}"
486
469
  unless tool.instance_variable_get('@prevent_action')
487
470
  # we add all specific tool actions to @tools_actions_to_exec hash
488
471
  # we set allow_tool_operations to false to ignore tool operation when clicking on a tool
@@ -495,10 +478,8 @@ class Atome
495
478
  tick[tool_name] = 0
496
479
  end
497
480
  end
498
- puts 'reactivation'
499
481
  tool.instance_variable_set('@prevent_action', false)
500
482
  end
501
-
502
483
  end
503
484
 
504
485
  end