MCPcopy Create free account
hub / github.com/KLayout/klayout / navigate

Method navigate

testdata/ruby/interactive/browser.rb:82–115  ·  view source on GitHub ↗

go to a certain location

( loc_index )

Source from the content-addressed store, hash-verified

80
81 # go to a certain location
82 def navigate( loc_index )
83
84 if loc_index < @boxes.size
85
86 # mark this location as visited
87 @visited[loc_index] = true
88
89 # place the marker on the current view. If no view is opened, this may be nil!
90 view = RBA::Application::instance.main_window.current_view
91 if view != nil
92
93 # zoom to the specified position (put 10 micron space around that location to
94 # get the displayed rectangle)
95 box = @boxes[loc_index]
96 view.zoom_box( box.enlarged( RBA::DPoint::new_xy( 10.0, 10.0 ) ) )
97
98 # before creating a new marker, delete the current marker unless it was destroyed already
99 # (this is a recommended safty measure)
100 if @marker != nil && !@marker.destroyed
101 @marker.destroy
102 end
103
104 # create a new marker that shows the box selected
105 @marker = RBA::Marker::new( view )
106 @marker.set_box( box )
107
108 end
109
110 # force a reload of the page (necessary, since the color of the links may have changed)
111 @browser.reload
112
113 end
114
115 end
116
117end
118

Callers

nothing calls this directly

Calls 10

main_windowMethod · 0.80
destroyedMethod · 0.80
sizeMethod · 0.45
current_viewMethod · 0.45
instanceMethod · 0.45
zoom_boxMethod · 0.45
enlargedMethod · 0.45
destroyMethod · 0.45
set_boxMethod · 0.45
reloadMethod · 0.45

Tested by

no test coverage detected