class_docstr: Mouse editing extension to the Line visual.
  This class adds mouse picking for line points, mouse_move handling for
  dragging existing points, and
  adding new points when clicking into empty space.
class_docstr_tok: ["Mouse","editing","extension","to","the","Line","visual",".","This","class","adds","mouse","picking","for","line","points",",","mouse_move","handling","for","dragging","existing","points",",","and","adding","new","points","when","clicking","into","empty","space","."]
code: def on_mouse_press(self, pos_scene):
      # pos_scene = event.pos[:3]
  
      # find closest point to mouse and select it
      self.selected_point, self.selected_index = self.select_point(
          pos_scene
      )
  
      # if no point was clicked add a new one
      if self.selected_point is None:
          print("adding point", len(self.pos))
          self._pos = np.append(self.pos, [pos_scene[:3]], axis=0)
          self.set_data(pos=self.pos)
          self.marker_colors = np.ones(
              (len(self.pos), 4), dtype=np.float32
          )
          self.selected_point = self.pos[-1]
          self.selected_index = len(self.pos) - 1
  
      # update markers and highlights
      self.update_markers(self.selected_index)
  
file_path: vispy/examples/basics/visuals/line_draw.py
imports: import numpy
  from vispy import app, scene
label_desc: Use image node_id 6 for calling the EditLineVisual obj's underlying member method code with example usage: obj.on_mouse_press(pos_scene) without return types