Draft: implement new get_param functions (step 1)

See #11677
This commit is contained in:
Roy-043
2023-12-11 19:31:34 +01:00
parent 6d0db27bd9
commit 59753260c9
21 changed files with 99 additions and 102 deletions

View File

@@ -30,8 +30,7 @@
from PySide.QtCore import QT_TRANSLATE_NOOP
import FreeCAD as App
import draftutils.utils as utils
from draftutils import params
from draftobjects.base import DraftObject
@@ -69,7 +68,7 @@ class BezCurve(DraftObject):
"The area of this object")
obj.addProperty("App::PropertyArea", "Area", "Draft", _tip)
obj.MakeFace = utils.get_param("fillmode", True)
obj.MakeFace = params.get_param("fillmode")
obj.Closed = False
obj.Degree = 3
obj.Continuity = []

View File

@@ -30,9 +30,8 @@
from PySide.QtCore import QT_TRANSLATE_NOOP
import FreeCAD as App
import draftutils.utils as utils
from draftobjects.base import DraftObject
from draftutils import params
class BSpline(DraftObject):
@@ -56,7 +55,7 @@ class BSpline(DraftObject):
_tip = QT_TRANSLATE_NOOP("App::Property", "The area of this object")
obj.addProperty("App::PropertyArea","Area", "Draft", _tip)
obj.MakeFace = utils.get_param("fillmode",True)
obj.MakeFace = params.get_param("fillmode")
obj.Closed = False
obj.Points = []
self.assureProperties(obj)

View File

@@ -30,9 +30,8 @@
from PySide.QtCore import QT_TRANSLATE_NOOP
import FreeCAD as App
import draftutils.utils as utils
from draftobjects.base import DraftObject
from draftutils import params
class Circle(DraftObject):
@@ -62,7 +61,7 @@ class Circle(DraftObject):
obj.addProperty("App::PropertyArea", "Area",
"Draft", _tip)
obj.MakeFace = utils.get_param("fillmode", True)
obj.MakeFace = params.get_param("fillmode")
def execute(self, obj):
"""This method is run when the object is created or recomputed."""

View File

@@ -30,9 +30,8 @@
from PySide.QtCore import QT_TRANSLATE_NOOP
import FreeCAD as App
import draftutils.utils as utils
from draftobjects.base import DraftObject
from draftutils import params
class Ellipse(DraftObject):
@@ -60,7 +59,7 @@ class Ellipse(DraftObject):
_tip = QT_TRANSLATE_NOOP("App::Property","Area of this object")
obj.addProperty("App::PropertyArea", "Area","Draft", _tip)
obj.MakeFace = utils.get_param("fillmode",True)
obj.MakeFace = params.get_param("fillmode")
def execute(self, obj):
if self.props_changed_placement_only():

View File

@@ -32,9 +32,8 @@ from PySide.QtCore import QT_TRANSLATE_NOOP
import FreeCAD as App
import DraftGeomUtils
from draftutils.utils import get_param
from draftobjects.base import DraftObject
from draftutils import params
class Polygon(DraftObject):
@@ -71,7 +70,7 @@ class Polygon(DraftObject):
"The area of this object")
obj.addProperty("App::PropertyArea", "Area", "Draft", _tip)
obj.MakeFace = get_param("fillmode",True)
obj.MakeFace = params.get_param("fillmode")
obj.DrawMode = ['inscribed','circumscribed']
obj.FacesNumber = 0
obj.Radius = 1

View File

@@ -31,9 +31,8 @@ from PySide.QtCore import QT_TRANSLATE_NOOP
import FreeCAD as App
import DraftGeomUtils
from draftutils.utils import get_param
from draftobjects.base import DraftObject
from draftutils import params
class Rectangle(DraftObject):
@@ -66,7 +65,7 @@ class Rectangle(DraftObject):
_tip = QT_TRANSLATE_NOOP("App::Property", "The area of this object")
obj.addProperty("App::PropertyArea", "Area", "Draft", _tip)
obj.MakeFace = get_param("fillmode",True)
obj.MakeFace = params.get_param("fillmode")
obj.Length=1
obj.Height=1
obj.Rows=1

View File

@@ -33,9 +33,8 @@ from PySide.QtCore import QT_TRANSLATE_NOOP
import FreeCAD as App
import DraftGeomUtils
import DraftVecUtils
from draftutils.utils import get_param
from draftobjects.base import DraftObject
from draftutils import params
class Wire(DraftObject):
@@ -92,7 +91,7 @@ class Wire(DraftObject):
"The area of this object")
obj.addProperty("App::PropertyArea","Area", "Draft",_tip)
obj.MakeFace = get_param("fillmode",True)
obj.MakeFace = params.get_param("fillmode")
obj.Closed = False
def execute(self, obj):