parameters: (self, arg)
docstring: Handle the 3D scene events.
  
          This is installed as an EventCallback in the Inventor view.
  
          Parameters
          ----------
          arg: dict
              Dictionary with strings that indicates the type of event received
              from the 3D view.
docstring_summary: Handle the 3D scene events.
docstring_tokens: Handle the 3D scene events .
function: def action(self, arg):
          """Handle the 3D scene events.
  
          This is installed as an EventCallback in the Inventor view.
  
          Parameters
          ----------
          arg: dict
              Dictionary with strings that indicates the type of event received
              from the 3D view.
          """
          if arg["Type"] == "SoKeyboardEvent":
              if arg["Key"] == "ESCAPE":
                  self.finish()
          elif arg["Type"] == "SoLocation2Event":
              if hasattr(Gui, "Snapper"):
                  Gui.Snapper.affinity = None  # don't keep affinity
              if len(self.node) == 2:
                  gui_tool_utils.setMod(arg, gui_tool_utils.MODCONSTRAIN, True)
              self.point, ctrlPoint, info = gui_tool_utils.getPoint(self, arg)
              gui_tool_utils.redraw3DView()
          elif arg["Type"] == "SoMouseButtonEvent":
              if (arg["State"] == "DOWN") and (arg["Button"] == "BUTTON1"):
                  if self.point:
                      self.ui.redraw()
                      if not self.node:
                          # first click
                          self.node.append(self.point)
                          self.ui.isRelative.show()
                          _msg(translate("draft",
                                         "Pick endpoint of leader line"))
                          if self.planetrack:
                              self.planetrack.set(self.point)
                      elif len(self.node) == 1:
                          # second click
                          self.node.append(self.point)
                          if self.ghost:
                              self.ghost.p1(self.node[0])
                              self.ghost.p2(self.node[1])
                              self.ghost.on()
                          _msg(translate("draft", "Pick text position"))
                      else:
                          # third click
                          self.node.append(self.point)
                          self.create()
function_tokens: def action ( self , arg ) : if arg [ "Type" ] == "SoKeyboardEvent" : if arg [ "Key" ] == "ESCAPE" : self . finish ( ) elif arg [ "Type" ] == "SoLocation2Event" : if hasattr ( Gui , "Snapper" ) : Gui . Snapper . affinity = None # don't keep affinity if len ( self . node ) == 2 : gui_tool_utils . setMod ( arg , gui_tool_utils . MODCONSTRAIN , True ) self . point , ctrlPoint , info = gui_tool_utils . getPoint ( self , arg ) gui_tool_utils . redraw3DView ( ) elif arg [ "Type" ] == "SoMouseButtonEvent" : if ( arg [ "State" ] == "DOWN" ) and ( arg [ "Button" ] == "BUTTON1" ) : if self . point : self . ui . redraw ( ) if not self . node : # first click self . node . append ( self . point ) self . ui . isRelative . show ( ) _msg ( translate ( "draft" , "Pick endpoint of leader line" ) ) if self . planetrack : self . planetrack . set ( self . point ) elif len ( self . node ) == 1 : # second click self . node . append ( self . point ) if self . ghost : self . ghost . p1 ( self . node [ 0 ] ) self . ghost . p2 ( self . node [ 1 ] ) self . ghost . on ( ) _msg ( translate ( "draft" , "Pick text position" ) ) else : # third click self . node . append ( self . point ) self . create ( )