Path: Refactor `Extensions` Gui code into independent module. Move the `Extensions` Gui code to independent module so access to other operations will be easier. Path: Add `Extensions` feature to Adaptive operation Path: Isolate Adaptive GUI elements in preparation of Adaptive unit tests Path: Implement `PathLog` debug module Path: Implement `translate()` for multi-language message support Path: Fix `StockType`check bug Path: Relocate `getCutRegionWires()` to `FeatureExtensions` module Path: Add `Extensions` property checks on document restored Path: Improve `Extend Outline` feature implementation Path: Initialize a waterline type extension Path: Add enable/disable extensions feature. It is quite possible that many complex faces exist that have large quantities of both simple and complex edges. For this reason, a manual push button to enable Extensions is useful so the users machine is not bogged down with extra or unnecessary computing time. Extensions are not necessary at all times. This commit also includes an edge count threshold that will disable the Extensions feature temporarily upon initial loading of the Task Panel. The manual enable button will do just that. Path: Add enable extensions warning label Path: Shorten enable/disable Extensions button message Path: Remove run-time added Task Panel elements - this QButton and QLabel were moved to UI panel directly. Path: Add include/ignore Edges button Path: Improve extension preview rendering Path: Fixes for `useOutline` modification and updates Path: Add internal feature to cache calculated extensions for reuse Path: Add `SetupProperties()` function and connect to GUI command Path: Add `Avoid Face` extension to ignore base face. This feature allows for some simple access to the exterior of a selected face without clearing the face itself. This will allow for an exterior clearing operation in a simple manner. Path: Fix bug restricting extensions on internal closed-wires
74 lines
3.6 KiB
Python
74 lines
3.6 KiB
Python
# -*- coding: utf-8 -*-
|
|
# ***************************************************************************
|
|
# * Copyright (c) 2017 sliptonic <shopinthewoods@gmail.com> *
|
|
# * *
|
|
# * This program is free software; you can redistribute it and/or modify *
|
|
# * it under the terms of the GNU Lesser General Public License (LGPL) *
|
|
# * as published by the Free Software Foundation; either version 2 of *
|
|
# * the License, or (at your option) any later version. *
|
|
# * for detail see the LICENCE text file. *
|
|
# * *
|
|
# * This program is distributed in the hope that it will be useful, *
|
|
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
# * GNU Library General Public License for more details. *
|
|
# * *
|
|
# * You should have received a copy of the GNU Library General Public *
|
|
# * License along with this program; if not, write to the Free Software *
|
|
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
|
# * USA *
|
|
# * *
|
|
# ***************************************************************************
|
|
|
|
import FreeCAD
|
|
import FreeCADGui
|
|
import PathGui as PGui # ensure Path/Gui/Resources are loaded
|
|
import PathScripts.PathGeom as PathGeom
|
|
import PathScripts.PathGui as PathGui
|
|
import PathScripts.PathLog as PathLog
|
|
import PathScripts.PathOpGui as PathOpGui
|
|
import PathScripts.PathPocketShape as PathPocketShape
|
|
import PathScripts.PathPocketBaseGui as PathPocketBaseGui
|
|
import PathScripts.PathFeatureExtensions as FeatureExtensions
|
|
import PathScripts.PathFeatureExtensionsGui as PathFeatureExtensionsGui
|
|
|
|
from PySide import QtCore, QtGui
|
|
from pivy import coin
|
|
|
|
# lazily loaded modules
|
|
from lazy_loader.lazy_loader import LazyLoader
|
|
Part = LazyLoader('Part', globals(), 'Part')
|
|
|
|
__title__ = "Path Pocket Shape Operation UI"
|
|
__author__ = "sliptonic (Brad Collette)"
|
|
__url__ = "https://www.freecadweb.org"
|
|
__doc__ = "Pocket Shape operation page controller and command implementation."
|
|
|
|
def translate(context, text, disambig=None):
|
|
return QtCore.QCoreApplication.translate(context, text, disambig)
|
|
|
|
PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule())
|
|
#PathLog.trackModule(PathLog.thisModule())
|
|
|
|
class TaskPanelOpPage(PathPocketBaseGui.TaskPanelOpPage):
|
|
'''Page controller class for Pocket operation'''
|
|
|
|
def pocketFeatures(self):
|
|
'''pocketFeatures() ... return FeaturePocket (see PathPocketBaseGui)'''
|
|
return PathPocketBaseGui.FeaturePocket | PathPocketBaseGui.FeatureOutline
|
|
|
|
def taskPanelBaseLocationPage(self, obj, features):
|
|
if not hasattr(self, 'extensionsPanel'):
|
|
self.extensionsPanel = PathFeatureExtensionsGui.TaskPanelExtensionPage(obj, features) # pylint: disable=attribute-defined-outside-init
|
|
return self.extensionsPanel
|
|
|
|
Command = PathOpGui.SetupOperation('Pocket Shape',
|
|
PathPocketShape.Create,
|
|
TaskPanelOpPage,
|
|
'Path_Pocket',
|
|
QtCore.QT_TRANSLATE_NOOP("Path_Pocket", "Pocket Shape"),
|
|
QtCore.QT_TRANSLATE_NOOP("Path_Pocket", "Creates a Path Pocket object from a face or faces"),
|
|
PathPocketShape.SetupProperties)
|
|
|
|
FreeCAD.Console.PrintLog("Loading PathPocketShapeGui... done\n")
|