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" and arg["Key"] == "ESCAPE":
              self.finish()
          elif arg["Type"] == "SoLocation2Event":
              self.point, ctrlPoint, info = gui_tool_utils.getPoint(self, arg)
              gui_tool_utils.redraw3DView()
          elif (arg["Type"] == "SoMouseButtonEvent"
                and arg["State"] == "DOWN"
                and arg["Button"] == "BUTTON1"):
              if arg["Position"] == self.pos:
                  return self.finish(False, cont=True)
              if (not self.node) and (not self.support):
                  gui_tool_utils.getSupport(arg)
                  (self.point,
                   ctrlPoint, info) = gui_tool_utils.getPoint(self, arg)
              if self.point:
                  self.ui.redraw()
                  self.pos = arg["Position"]
                  self.node.append(self.point)
                  self.drawSegment(self.point)
                  if not self.isWire and len(self.node) == 2:
                      self.finish(False, cont=True)
                  if len(self.node) > 2:
                      # The wire is closed
                      if (self.point - self.node[0]).Length < utils.tolerance():
                          self.undolast()
                          if len(self.node) > 2:
                              self.finish(True, cont=True)
                          else:
                              self.finish(False, cont=True)
function_tokens: def action ( self , arg ) : if arg [ "Type" ] == "SoKeyboardEvent" and arg [ "Key" ] == "ESCAPE" : self . finish ( ) elif arg [ "Type" ] == "SoLocation2Event" : self . point , ctrlPoint , info = gui_tool_utils . getPoint ( self , arg ) gui_tool_utils . redraw3DView ( ) elif ( arg [ "Type" ] == "SoMouseButtonEvent" and arg [ "State" ] == "DOWN" and arg [ "Button" ] == "BUTTON1" ) : if arg [ "Position" ] == self . pos : return self . finish ( False , cont = True ) if ( not self . node ) and ( not self . support ) : gui_tool_utils . getSupport ( arg ) ( self . point , ctrlPoint , info ) = gui_tool_utils . getPoint ( self , arg ) if self . point : self . ui . redraw ( ) self . pos = arg [ "Position" ] self . node . append ( self . point ) self . drawSegment ( self . point ) if not self . isWire and len ( self . node ) == 2 : self . finish ( False , cont = True ) if len ( self . node ) > 2 : # The wire is closed if ( self . point - self . node [ 0 ] ) . Length < utils . tolerance ( ) : self . undolast ( ) if len ( self . node ) > 2 : self . finish ( True , cont = True ) else : self . finish ( False , cont = True )