Ejemplo n.º 1
0
 def finish(self):
     ## TODO Make sure it finishes when push "Close" or escape
     FreeCAD.activeDocument().recompute()
     self.call_sel = None
     self.call_key = None
     self.call_status = None
     Modifier.finish(self)
Ejemplo n.º 2
0
 def finish(self,closed=False,cont=False):
     if self.ghost:
         for typ in self.ghost:
             for g in [i for i in self.ghost[typ]]:
                 if g.switch:
                     g.off()
                 g.finalize()
     if cont and self.ui:
         if self.ui.continueMode:
             todo.delayAfter(self.Activated,[])
     Modifier.finish(self)
Ejemplo n.º 3
0
 def __init__(self):
     Modifier.__init__(self)
     self.keys = {
         'g': lambda x: bimMove(x),
         'r': lambda x: bimRotate(x),
         #'s': lambda x: bimScale(x),
         #'m': lambda x: bimMirror(x),
         #'t': lambda x: bimStretch(x),
     }
     self.call_sel = None
     self.call_key = None
     self.call_status = None
     self.selection = []
     self.sel_options = sorted(selectionOption().keys())
     self.sel_opt_no = 0
Ejemplo n.º 4
0
    def Activated(self):
        """
        Command activation method
        """

        #generate a spiral with two radii given the arcs on either side
        #and render it
        Modifier.Activated(self, 'SpiralTest')

        arc1 = {
            'BearingIn': math.pi / 2.0,
            'Radius': 2600.0,
            'Delta': math.radians(44.821592613698),
            'Start': App.Vector(),
            'Direction': -1
        }

        arc1 = arc.get_parameters(arc1)

        arc2 = {
            'BearingIn': 0.0,
            'Radius': 1750.0,
            'Delta': math.radians(16.074936823812),
            'Start': App.Vector(),
            'Direction': -1
        }

        arc2 = arc.get_parameters(arc2)
Ejemplo n.º 5
0
 def finish(self,closed=False,cont=False):
     "finishes the arc"
     if self.arctrack:
         self.arctrack.finalize()
     if self.ghost:
         for typ in self.ghost:
             for g in [i for i in self.ghost[typ]]:
                 if g.switch:
                     g.off()
                 g.finalize()
     if cont and self.ui:
         if self.ui.continueMode:
             todo.delayAfter(self.Activated,[])
     Modifier.finish(self)
     if self.doc:
         self.doc.recompute()
Ejemplo n.º 6
0
    def Activated(self):
        """
        Command activation method
        """

        cz._zoom_camera(cz.Camera())

        Modifier.Activated(self, 'TestZoom')
Ejemplo n.º 7
0
    def Activated(self):
        """
        Command activation method
        """

        Modifier.Activated(self, 'Command')

        self.tracker = editTracker(App.Vector(), 'test', 0)
Ejemplo n.º 8
0
    def Activated(self):
        """
        Command activation method
        """
        #create alignment editing task
        self.task = PivyTrackerTask()

        Modifier.Activated(self, 'PivyTrackerCommand')
Ejemplo n.º 9
0
    def Activated(self):
        """
        Command activation method
        """
        #create alignment editing task
        self.task = SelectDragTask()

        Modifier.Activated(self, 'SelectDragCommand')
    def Activated(self):
        """
        Command activation method
        """

        panel = Panel()
        Gui.Control.showDialog(panel)

        Modifier.Activated(self, 'TrailsGuide')
Ejemplo n.º 11
0
 def Activated(self):
     self.name = translate("draft","Scale", utf8_decode=True)
     Modifier.Activated(self,self.name)
     self.ghost = None
     if self.ui:
         if not FreeCADGui.Selection.getSelection():
             self.ui.selectUi()
             msg(translate("draft", "Select an object to scale")+"\n")
             self.call = self.view.addEventCallback("SoEvent",selectObject)
         else:
             self.proceed()
Ejemplo n.º 12
0
 def Activated(self):
     self.name = translate("draft", "BaseTransform", utf8_decode=True)
     Modifier.Activated(self, self.name)
     if self.ui:
         if not FreeCADGui.Selection.getSelection():
             self.ui.selectUi()
             msg(translate("draft", "Select an object to edit") + "\n")
             self.call_sel = \
                     self.view.addEventCallback("SoEvent", selectObject)
             ## TODO it should allow multiple selections
             ## TODO Ui should be more explanatory
         else:
             self.proceed()
    def Activated(self):
        """
        Command activation method
        """

        self.doc = App.ActiveDocument

        ViewState().view = Gui.ActiveDocument.ActiveView

        #create alignment editing task
        self.task = SpriteSplitterTask(self.doc)

        Gui.Control.showDialog(self.task)
        self.task.setup()

        Modifier.Activated(self, 'SpriteSplitter')
Ejemplo n.º 14
0
    def Activated(self):
        """
        Command activation method
        """

        self.doc = App.ActiveDocument

        #create working, non-visual copy of horizontal alignment
        obj = Gui.Selection.getSelection()[0]
        data = obj.Proxy.get_data_copy()

        self.doc = App.ActiveDocument
        ViewState().view = Gui.ActiveDocument.ActiveView

        #create alignment editing task
        self.task = \
            base_tracker_test_task.create(self.doc, data, obj, self.is_linked)

        Gui.Control.showDialog(self.task)
        self.task.setup()

        Modifier.Activated(self, 'BaseTrackerTest')
    def Activated(self):
        """
        Command activation method
        """

        self.doc = App.ActiveDocument

        #create working, non-visual copy of horizontal alignment
        obj = Gui.Selection.getSelection()[0]
        data = obj.Proxy.get_data_copy()

        self.doc = App.ActiveDocument
        ViewState().view = Gui.ActiveDocument.ActiveView

        #create alignment editing task
        self.task = edit_alignment_task.create(self.doc, data, obj)

        #cz._zoom_camera(cz.Camera())

        Gui.Control.showDialog(self.task)
        self.task.setup()

        Modifier.Activated(self, 'EditAlignmentCommand')
Ejemplo n.º 16
0
    def Activated(self):
        from bimEdit import hideAttribute
        self.name = translate("draft","bimMove", utf8_decode=True)
        Modifier.Activated(self,self.name)
        self.ghost = {}
        for typ in self.sel_dict:
            if typ not in self.ghost:
                self.ghost.update({typ:[]})
            for o in self.sel_dict[typ]:
                self.ghost[typ].append(o.ghost[typ])

        ## Proceeding
        if self.call:
            self.view.removeEventCallback("SoEvent",self.call)
        self.ui.pointUi(self.name)
        self.ui.modUi()
        if self.copymode:
            self.ui.isCopy.setChecked(True)
        self.ui.xValue.setFocus()
        self.ui.xValue.selectAll()

        self.call = self.view.addEventCallback("SoEvent",self.action)
        msg(translate("draft", "Pick start point:")+"\n")
Ejemplo n.º 17
0
    def Activated(self):
        from bimEdit import hideAttribute
        self.name = translate("draft","bimRotate", utf8_decode=True)
        Modifier.Activated(self,self.name)
        self.ghost = {}
        for typ in self.sel_dict:
            if typ not in self.ghost:
                self.ghost.update({typ:[]})
            for o in self.sel_dict[typ]:
                self.ghost[typ].append(o.ghost[typ])
        self.arctrack = None

        ## Proceeding
        if self.call:
            self.view.removeEventCallback("SoEvent",self.call)
        self.step = 0
        self.center = None
        self.ui.arcUi()
        self.ui.modUi()
        self.ui.setTitle("Rotate")
        self.arctrack = arcTracker()
        self.call = self.view.addEventCallback("SoEvent",self.action)

        msg(translate("draft", "Pick rotation center:")+"\n")
Ejemplo n.º 18
0
    def Activated(self):
        """
        Command activation method
        """

        Modifier.Activated(self, 'Command')
Ejemplo n.º 19
0
 def finish(self,closed=False,cont=False):
     Modifier.finish(self)
     if self.ghost:
         self.ghost.finalize()