FreeCAD

Форк
0
/
gui_edit_base_object.py 
109 строк · 4.1 Кб
1
# ***************************************************************************
2
# *   Copyright (c) 2019, 2020 Carlo Pavan <carlopav@gmail.com>             *
3
# *                                                                         *
4
# *   This program is free software; you can redistribute it and/or modify  *
5
# *   it under the terms of the GNU Lesser General Public License (LGPL)    *
6
# *   as published by the Free Software Foundation; either version 2 of     *
7
# *   the License, or (at your option) any later version.                   *
8
# *   for detail see the LICENCE text file.                                 *
9
# *                                                                         *
10
# *   This program is distributed in the hope that it will be useful,       *
11
# *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12
# *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13
# *   GNU Library General Public License for more details.                  *
14
# *                                                                         *
15
# *   You should have received a copy of the GNU Library General Public     *
16
# *   License along with this program; if not, write to the Free Software   *
17
# *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
18
# *   USA                                                                   *
19
# *                                                                         *
20
# ***************************************************************************
21
"""Provides support functions to edit Arch objects."""
22
## @package gui_edit_arch_objects
23
# \ingroup draftguitools
24
# \brief Provides support functions to edit Arch objects.
25

26
__title__ = "FreeCAD Draft Edit Tool"
27
__author__ = ("Carlo Pavan")
28
__url__ = "https://www.freecad.org"
29

30
## \addtogroup draftguitools
31
# @{
32

33

34
class GuiTools:
35
    """ Base class for object editing tools
36
    """
37

38
    def __init__(self):
39
        pass
40

41
    def get_edit_points(self, obj):
42
        """Return to Draft_Edit a list of vectors for the given object.
43
        Remember to use object local coordinates system.
44

45
        Parameters:
46
        obj: the object
47
        """
48
        pass
49

50
    def update_object_from_edit_points(self, obj, node_idx, v, alt_edit_mode=0):
51
        """Update the object from modified Draft_Edit point.
52
        No need to recompute at the end.
53

54
        Parameters:
55
        obj: the object
56
        node_idx: number of the edited node
57
        v: target vector of the node in object local coordinates system
58
        alt_edit_mode: alternative edit mode to perform different operations
59
                       (usually can be selected from the Draft_Edit context menu)
60
                       default = 0
61
        """
62
        pass
63

64
    def get_edit_point_context_menu(self, edit_command, obj, node_idx):
65
        """ Get the context menu associated to edit points (user is over an editpoint)
66

67
        Return a list of tuples containing menu labels and associated functions:
68
            return [
69
                ("action label", lambda: self.handle_action_label(edit_command, obj, node_idx)),
70
            ]
71

72
        Parameters:
73
        edit_command: running Draft_Edit command
74
        obj: the edited object
75
        node_idx: number of the edited node
76
        """
77
        pass
78

79
    def get_edit_obj_context_menu(self, edit_command, obj, position):
80
        """ Get the context menu associated to edited object (user is over the object)
81

82
        Return a list of tuples containing menu labels and associated functions:
83
            return [
84
                ("action label", lambda: self.handle_action_label(edit_command, obj, position)),
85
            ]
86

87
        Parameters:
88
        edit_command: running Draft_Edit command
89
        obj: the edited object
90
        position: position of the cursor on the screen (x, y)
91
        """
92
        pass
93

94
    def get_object_style(self, obj):
95
        pass
96

97
    def set_object_editing_style(self, obj):
98
        pass
99

100
    def restore_object_style(self, obj, modes):
101
        pass
102

103
    def init_preview_object(self, obj):
104
        pass
105

106
    def update_preview_object(self, edit_command, obj, node_idx, v):
107
        pass
108

109
## @}
110

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.