Sketchup::EntitiesObserver
Author | Manuela Ruiz (mruiz@lcc.uma.es) |
This class represents the observer for a rule shape group. There is one observer of this kind for every present rule shape.
Method that triggers when some element is added into a rule shape group, in order to update the internal representation of the affected rule shape
# File lib/interfaces/guitools.rb, line 49 49: def onElementAdded(entities, entity) 50: 51: if !Shade.project.modifying 52: 53: Shade.project.modifying = true 54: execution = Shade.project.execution 55: layer_name = Sketchup.active_model.active_layer.name 56: @shape.refresh_from_entities(entities, @shape.transformation(layer_name), layer_name) 57: execution.grammar.saved = false 58: Shade.project.modifying = false 59: end 60: end
Method that triggers when something is modified inside a rule shape group, in order to update the internal representation of the affected rule shape
# File lib/interfaces/guitools.rb, line 20 20: def onElementModified(entities, entity) 21: 22: if !Shade.project.modifying 23: if !Shade.project.erasing 24: Shade.project.modifying = true 25: execution = Shade.project.execution 26: layer_name = Sketchup.active_model.active_layer.name 27: @shape.refresh_from_entities(entities, @shape.transformation(layer_name), layer_name) 28: execution.grammar.saved = false 29: Shade.project.modifying = false 30: end 31: end 32: end
Method that triggers when some element is removed from a rule shape group, in order to update the internal representation of the affected rule shape
# File lib/interfaces/guitools.rb, line 63 63: def onElementRemoved(entities, entity_id) 64: 65: if !Shade.project.modifying 66: Shade.project.modifying = true 67: execution = Shade.project.execution 68: layer_name = Sketchup.active_model.active_layer.name 69: @shape.refresh_from_entities(entities, @shape.transformation(layer_name), layer_name) 70: execution.grammar.saved = false 71: Shade.project.modifying = false 72: end 73: end
Method that triggers when a rule shape group is erased, in order to update the internal representation of the affected rule shape
# File lib/interfaces/guitools.rb, line 35 35: def onEraseEntities(entities) 36: 37: if !Shade.project.modifying 38: Shade.project.modifying = true 39: layer_name = Sketchup.active_model.active_layer.name 40: @shape.p[layer_name] = LinearLinkedList.new 41: @shape.s[layer_name] = LinearLinkedList.new 42: execution = Shade.project.execution 43: execution.grammar.saved = false 44: Shade.project.modifying = false 45: end 46: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.