Exemplo n.º 1
0
    def hide(self):
        """
        Hide the widgets. Remove also the tab.
        TODO:
        For this tool, I decide to choose the hide to merge, or leave it "as is" here. 
        I can do that during the extrusion (moving the Wheel), but that will be an action
        without undo. Here the user will be finished with the extrusion and want to leave the tool
        TODO: If there will be a wheelussion about this, we might change this behavior!!
        """

        if (self.OperationOption == 0):
            pass  # Here just to make the code clear that we do nothing otherwise it != necessary
        elif (self.OperationOption == 1):
            # Merge the new object with the old object
            # There are several cases here
            # 1- Old object was only 2D object --
            #    nothing will be done but we must see if the new object != intersecting other objects
            # 2- Old object is intersecting with new object..
            # In case 1 and 2 when there is intersecting we should merge both
            if (self.isFaceOf3DObj() is True):
                # No 3D but collision might happen.
                pass

        self.dialog.hide()
        del self.dialog
        dw = self.mw.findChildren(QtGui.QDockWidget)
        newsize = self.tab.count()  # Todo : Should we do that?
        self.tab.removeTab(newsize - 1)  # it ==0,1,2,3 ..etc
        App.ActiveDocument.commitTransaction()  # undo reg.
        App.ActiveDocument.recompute()
        faced.showFirstTab()
        self.__del__()  # Remove all smart Extrude Rotate 3dCOIN widgets
Exemplo n.º 2
0
    def hide(self):
        """
        Hide the widgets. Remove also the tab.
        TODO:
        For this tool, I decide to choose the hide to merge, or leave it "as is" here.
        I can do that during the extrusion (moving the disc), but that will be an action
        without undo. Here the user will be finished with the extrusion and want to leave the tool
        TODO: If there will be a discussion about this, we might change this behavior!!
        """
        try:
            App.ActiveDocument.commitTransaction()  #undo reg.

            self.dialog.hide()
            self.recreateObject()

            # Remove coin objects
            self.coinFaces.removeAllChildren()
            self.sg.removeChild(self.coinFaces)

            del self.dialog
            dw = self.mw.findChildren(QtGui.QDockWidget)
            newsize = self.tab.count()  # Todo : Should we do that?
            self.tab.removeTab(newsize - 1)  # it ==0,1,2,3 .etc

            App.ActiveDocument.commitTransaction()  # undo reg.
            faced.showFirstTab()
            self.__del__()  # Remove all smart Extrude Rotate 3dCOIN widgets

        except Exception as err:
            App.Console.PrintError("'ExtendEdge' hide- Failed. "
                                   "{err}\n".format(err=str(err)))
            exc_type, exc_obj, exc_tb = sys.exc_info()
            fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
            print(exc_type, fname, exc_tb.tb_lineno)
Exemplo n.º 3
0
    def hide(self):
        """
        Hide the widgets. Remove also the tab.
        TODO:
        For this tool, I decide to choose the hide to merge, or leave it "as is" here.
        I can do that during the extrusion (moving the pad), but that will be an action
        without undo. Here the user will be finished with the extrusion and want to leave the tool
        TODO: If there will be a discussion about this, we might change this behavior!!
        """
        App.ActiveDocument.commitTransaction()  #undo reg.

        self.dialog.hide()
        self.recreateObject()

        # Remove coin objects
        self.coinFaces.removeAllChildren()
        self.sg.removeChild(self.coinFaces)

        del self.dialog
        dw = self.mw.findChildren(QtGui.QDockWidget)
        newsize = self.tab.count()  # Todo : Should we do that?
        self.tab.removeTab(newsize - 1)  # it ==0,1,2,3 .etc

        App.ActiveDocument.commitTransaction()  # undo reg.
        faced.showFirstTab()
        self.__del__()  # Remove all smart Extrude Rotate 3dCOIN widgets
Exemplo n.º 4
0
 def hideDialog(self):
     self.dialog.hide()
     dw = self.mw.findChildren(QtGui.QDockWidget)
     newsize = self.tab.count()  # Todo : Should we do that?
     self.tab.removeTab(newsize-1)  # it ==0,1,2,3 ..etc
     del self.dialog
     faced.showFirstTab()
     return
Exemplo n.º 5
0
 def hide(self):
     """
     Hide the widgets. Remove also the tab.
     """
     self.dialog.hide()
     del self.dialog
     dw = self.mw.findChildren(QtGui.QDockWidget)
     newsize = self.tab.count()  # Todo : Should we do that?
     self.tab.removeTab(newsize - 1)  # it ==0,1,2,3 ..etc
     temp = self.selectedObj[0]
     App.ActiveDocument.recompute()
     faced.showFirstTab()
     self.__del__()  # Remove all smart Alignment 3dCOIN widgets
Exemplo n.º 6
0
    def hide(self):
        try:
            self.dialog.hide()
            del self.dialog
            dw = self.mw.findChildren(QtGui.QDockWidget)
            newsize = self.tab.count()
            self.tab.removeTab(newsize - 1)  # it ==0,1,2,3 ..etc
            faced.showFirstTab()
            self.__del__()  # Remove all smart scale 3dCOIN widgets

        except Exception as err:
            App.Console.PrintError("'Design456_SmartScale' hide-Failed. "
                                   "{err}\n".format(err=str(err)))
            exc_type, exc_obj, exc_tb = sys.exc_info()
            fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
            print(exc_type, fname, exc_tb.tb_lineno)
Exemplo n.º 7
0
    def hide(self):
        """
        Hide the widgets. Remove also the tab.
        """
        try:
            self.setObjctsColor(True)
            self.dialog.hide()
            del self.dialog
            dw = self.mw.findChildren(QtGui.QDockWidget)
            newsize = self.tab.count()  # Todo : Should we do that?
            self.tab.removeTab(newsize-1)  # it ==0,1,2,3 ..etc

            App.ActiveDocument.recompute()
            faced.showFirstTab()
            self.__del__()  # Remove all smart Alignment 3dCOIN widgets
            
        except Exception as err:
            App.Console.PrintError("'Design456_Alignment' getMainWindow-Failed. "
                                   "{err}\n".format(err=str(err)))
            exc_type, exc_obj, exc_tb = sys.exc_info()
            fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
            print(exc_type, fname, exc_tb.tb_lineno)