Files
create/src/Mod/Draft/draftviewproviders/view_draftlink.py
vocx-fc 8e9fb40fa3 Draft: add modules of draftviewproviders to the proper Doxygen group
This includes `view_array`, `view_base`, `view_bezcurve`,
`view_bspline`, `view_circulararray`, `view_clone`, `view_dimension`,
`view_draft_annotation`, `view_draftlink`, `view_facebinder`,
`view_fillet`, `view_label`, `view_orthoarray`, `view_point`,
`view_polararray`, `view_rectangle`, `view_text`, `view_wire`,
`view_wpproxy`.

These are added to the `draftviewproviders` Doxygen group
so that the functions and classes contained in each module
are listed appropriately in the automatically generated
documentation.
2020-07-17 13:01:45 +02:00

77 lines
3.1 KiB
Python

# ***************************************************************************
# * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> *
# * Copyright (c) 2020 FreeCAD Developers *
# * *
# * 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 *
# * *
# ***************************************************************************
"""Provides the base viewprovider code for the Link objects."""
## @package view_draftlink
# \ingroup draftviewproviders
# \brief Provides the base viewprovider code for the Link objects.
## \addtogroup draftviewproviders
# @{
class ViewProviderDraftLink:
""" A view provider for link type object.
"""
def __init__(self,vobj):
self.Object = vobj.Object
vobj.Proxy = self
def attach(self,vobj):
self.Object = vobj.Object
def __getstate__(self):
return None
def __setstate__(self, state):
return None
def getIcon(self):
tp = self.Object.Proxy.Type
if tp == 'Array':
if self.Object.ArrayType == 'ortho':
return ":/icons/Draft_LinkArray.svg"
elif self.Object.ArrayType == 'polar':
return ":/icons/Draft_PolarLinkArray.svg"
elif self.Object.ArrayType == 'circular':
return ":/icons/Draft_CircularLinkArray.svg"
elif tp == 'PathArray':
return ":/icons/Draft_PathLinkArray.svg"
def claimChildren(self):
obj = self.Object
if hasattr(obj,'ExpandArray'):
expand = obj.ExpandArray
else:
expand = obj.ShowElement
if not expand:
return [obj.Base]
else:
return obj.ElementList
# Alias for compatibility with old versions of v0.19
_ViewProviderDraftLink = ViewProviderDraftLink
## @}