[Draft] Cleanup of Annotation style branch
Further cleanup and guarded imports of Gui in modules. .
This commit is contained in:
committed by
Yorik van Havre
parent
cb4295fd8a
commit
a4f7bc43f6
@@ -23,7 +23,7 @@
|
||||
# ***************************************************************************
|
||||
"""This module provides the Draft Dimensions view provider classes
|
||||
"""
|
||||
## @package polararray
|
||||
## @package dimension
|
||||
# \ingroup DRAFT
|
||||
# \brief This module provides the view provider code for Draft Dimensions.
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
"""This module provides the view provider code for Draft DimensionStyle.
|
||||
"""
|
||||
## @package polararray
|
||||
## @package dimensionstyle
|
||||
# \ingroup DRAFT
|
||||
# \brief This module provides the view provider code for Draft DimensionStyle.
|
||||
|
||||
@@ -31,7 +31,6 @@ from Draft import _ViewProviderDraft
|
||||
from PySide.QtCore import QT_TRANSLATE_NOOP
|
||||
import draftutils.utils as utils
|
||||
from pivy import coin
|
||||
from draftviewproviders.view_draft_annotation import ViewProviderDraftAnnotation
|
||||
from draftviewproviders.view_draft_annotation import ViewProviderAnnotationStylesContainer
|
||||
from draftviewproviders.view_dimension import ViewProviderDimensionBase
|
||||
|
||||
|
||||
@@ -21,16 +21,16 @@
|
||||
# ***************************************************************************
|
||||
"""This module provides the Draft Annotations view provider base class
|
||||
"""
|
||||
## @package polararray
|
||||
## @package annotation
|
||||
# \ingroup DRAFT
|
||||
# \brief This module provides the Draft Annotations view provider base class
|
||||
|
||||
|
||||
import FreeCAD as App
|
||||
import FreeCADGui as Gui
|
||||
from PySide.QtCore import QT_TRANSLATE_NOOP
|
||||
|
||||
|
||||
if App.GuiUp:
|
||||
import FreeCADGui as Gui
|
||||
|
||||
class ViewProviderAnnotationStylesContainer:
|
||||
"""A View Provider for the Layer Container"""
|
||||
|
||||
@@ -21,15 +21,14 @@
|
||||
# * USA *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
"""This module provides the Draft Dimensions view provider classes
|
||||
"""This module provides the Draft Label view provider classes
|
||||
"""
|
||||
## @package polararray
|
||||
## @package label
|
||||
# \ingroup DRAFT
|
||||
# \brief This module provides the view provider code for Draft Dimensions.
|
||||
# \brief This module provides the view provider code for Draft Label.
|
||||
|
||||
|
||||
import FreeCAD as App
|
||||
import FreeCADGui as Gui
|
||||
import DraftVecUtils, DraftGeomUtils
|
||||
import math, sys
|
||||
from pivy import coin
|
||||
@@ -38,6 +37,10 @@ import draftutils.utils as utils
|
||||
import draftutils.gui_utils as gui_utils
|
||||
from draftviewproviders.view_draft_annotation import ViewProviderDraftAnnotation
|
||||
|
||||
if App.GuiUp:
|
||||
import FreeCADGui as Gui
|
||||
|
||||
|
||||
class ViewProviderLabel(ViewProviderDraftAnnotation):
|
||||
"""A View Provider for the Label annotation object"""
|
||||
|
||||
@@ -111,7 +114,6 @@ class ViewProviderLabel(ViewProviderDraftAnnotation):
|
||||
|
||||
|
||||
def getIcon(self):
|
||||
import Draft_rc
|
||||
return ":/icons/Draft_Label.svg"
|
||||
|
||||
def claimChildren(self):
|
||||
@@ -212,7 +214,6 @@ class ViewProviderLabel(ViewProviderDraftAnnotation):
|
||||
self.onChanged(obj.ViewObject,"TextAlignment")
|
||||
|
||||
def getTextSize(self,vobj):
|
||||
from pivy import coin
|
||||
if vobj.DisplayMode == "3D text":
|
||||
text = self.text3d
|
||||
else:
|
||||
@@ -311,10 +312,4 @@ class ViewProviderLabel(ViewProviderDraftAnnotation):
|
||||
v = vobj.Object.Placement.Rotation.multVec(v)
|
||||
pos = vobj.Object.Placement.Base.add(v)
|
||||
self.textpos.translation.setValue(pos)
|
||||
self.textpos.rotation.setValue(vobj.Object.Placement.Rotation.Q)
|
||||
|
||||
def __getstate__(self):
|
||||
return None
|
||||
|
||||
def __setstate__(self,state):
|
||||
return None
|
||||
self.textpos.rotation.setValue(vobj.Object.Placement.Rotation.Q)
|
||||
@@ -21,15 +21,14 @@
|
||||
# * USA *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
"""This module provides the Draft Dimensions view provider classes
|
||||
"""This module provides the Draft Text view provider classes
|
||||
"""
|
||||
## @package polararray
|
||||
## @package text
|
||||
# \ingroup DRAFT
|
||||
# \brief This module provides the view provider code for Draft Dimensions.
|
||||
# \brief This module provides the view provider code for Draft Text.
|
||||
|
||||
|
||||
import FreeCAD as App
|
||||
import FreeCADGui as Gui
|
||||
import DraftVecUtils, DraftGeomUtils
|
||||
import math, sys
|
||||
from pivy import coin
|
||||
@@ -40,7 +39,7 @@ from draftviewproviders.view_draft_annotation import ViewProviderDraftAnnotation
|
||||
|
||||
|
||||
class ViewProviderText(ViewProviderDraftAnnotation):
|
||||
"""A View Provider for the Draft Label"""
|
||||
"""A View Provider for the Draft Text annotation"""
|
||||
|
||||
def __init__(self,vobj):
|
||||
|
||||
@@ -161,10 +160,4 @@ class ViewProviderText(ViewProviderDraftAnnotation):
|
||||
elif prop == "LineSpacing":
|
||||
if "LineSpacing" in vobj.PropertiesList:
|
||||
self.text2d.spacing = vobj.LineSpacing
|
||||
self.text3d.spacing = vobj.LineSpacing
|
||||
|
||||
def __getstate__(self):
|
||||
return None
|
||||
|
||||
def __setstate__(self,state):
|
||||
return None
|
||||
self.text3d.spacing = vobj.LineSpacing
|
||||
Reference in New Issue
Block a user