def __init__(self, obj):
     obj.addProperty('App::PropertyPythonObject',
                     'parts').parts = PropertiesList()
     obj.addProperty('App::PropertyPythonObject',
                     'faces').faces = PropertiesList()
     obj.addProperty('App::PropertyPythonObject',
                     'need_recompute').need_recompute = False
     obj.addProperty('App::PropertyPythonObject',
                     'preview').preview = PREVIEW_NONE
     obj.addProperty('App::PropertyLinkList',
                     'generatedParts').generatedParts = []
     obj.addProperty('App::PropertyLinkList', 'fromParts').fromParts = []
     obj.addProperty('App::PropertyPythonObject', 'edit').edit = False
     obj.addProperty('App::PropertyPythonObject',
                     'namesMapping').namesMapping = {}
     obj.Proxy = self
Exemple #2
0
 def __init__(self, obj, freecad_obj):
     obj.addProperty('App::PropertyPythonObject', 'globalProperties'
                     ).globalProperties = GlobalLivingMaterialProperties(
                         freecad_object=freecad_obj)
     obj.addProperty('App::PropertyPythonObject',
                     'hinges').hinges = PropertiesList()
     obj.addProperty('App::PropertyPythonObject',
                     'need_recompute').need_recompute = False
     obj.addProperty('App::PropertyLink', 'solid').solid = None
     obj.addProperty('App::PropertyLink', 'obj').obj = None
     obj.Proxy = self
Exemple #3
0
    def __init__(self, title, obj_join=None):  #none to be removed
        self.form = []
        self.obj_join = obj_join
        self.parts = self.obj_join.parts
        if hasattr(self.obj_join, "faces"):
            self.faces = self.obj_join.faces
        else:
            self.faces = PropertiesList()

        if title != "Crosspiece":
            self.partsList = PartsList(Part, self.parts)
        else:
            self.partsList = PartsList(CrossPartWidget, self.parts)
        self.tabsList = TabsList(self.faces)

        self.params_widget = None
        if self.params_widget:
            self.form.append(self.params_widget)
        self.hide_button = None
        self.show_button = None
        self.reset_transparency_button = None
        self.set_transparency_button = None
        self.active_document = self.obj_join.Document  #FreeCAD.ActiveDocument
        self.tree_widget = QtGui.QWidget()
        self.tree_widget.setObjectName("TreePanel")
        self.tree_widget.setWindowTitle(title)
        self.tree_vbox = QtGui.QVBoxLayout(self.tree_widget)
        self.form.append(self.tree_widget)
        self.model = TreeModel()
        self.tree_view_widget = QtGui.QTreeView()
        self.tree_view_widget.setSelectionMode(
            QtGui.QAbstractItemView.ExtendedSelection)
        self.tree_view_widget.setModel(self.model)
        self.tree_view_widget.setFixedHeight(250)
        self.selection_model = None
        self.tab_type_box = None
        self.edited_items = []
        self.edit_items_layout = None
        self.init_tree_widget()
        self.preview_doc = None
        self.show_other_state_checkbox = None
        self.other_object_list = []
        self.save_initial_objects()

        for item in self.parts:
            self.model.append_part(item.name, item.label, bool(item.link_name))

        for item in self.faces:
            self.model.append_tab(item.freecad_obj_name, item.tab_name,
                                  item.face_name, bool(item.link_name))