molde 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- molde/__init__.py +5 -0
- molde/__main__.py +63 -0
- molde/actors/__init__.py +4 -0
- molde/actors/ghost_actor.py +12 -0
- molde/actors/lines_actor.py +31 -0
- molde/actors/round_points_actor.py +7 -0
- molde/actors/square_points_actor.py +32 -0
- molde/colors/__init__.py +2 -0
- molde/colors/color.py +120 -0
- molde/colors/color_names.py +125 -0
- molde/fonts/IBMPlexMono-Bold.ttf +0 -0
- molde/fonts/IBMPlexMono-Regular.ttf +0 -0
- molde/icons/arrow_down_dark_theme.svg +1 -0
- molde/icons/arrow_down_disabled_dark_theme.svg +1 -0
- molde/icons/arrow_down_disabled_light_theme.svg +1 -0
- molde/icons/arrow_down_light_theme.svg +1 -0
- molde/icons/arrow_left_dark_theme.svg +1 -0
- molde/icons/arrow_left_light_theme.svg +1 -0
- molde/icons/arrow_right_dark_theme.svg +1 -0
- molde/icons/arrow_right_light_theme.svg +1 -0
- molde/icons/arrow_up_dark_theme.svg +1 -0
- molde/icons/arrow_up_disabled_dark_theme.svg +1 -0
- molde/icons/arrow_up_disabled_light_theme.svg +1 -0
- molde/icons/arrow_up_light_theme.svg +1 -0
- molde/icons/check_box_image.svg +1 -0
- molde/interactor_styles/__init__.py +2 -0
- molde/interactor_styles/arcball_camera_style.py +272 -0
- molde/interactor_styles/box_selection_style.py +70 -0
- molde/pickers/__init__.py +2 -0
- molde/pickers/cell_area_picker.py +61 -0
- molde/pickers/cell_property_area_picker.py +84 -0
- molde/poly_data/__init__.py +2 -0
- molde/poly_data/lines_data.py +23 -0
- molde/poly_data/vertices_data.py +24 -0
- molde/render_widgets/__init__.py +2 -0
- molde/render_widgets/animated_render_widget.py +164 -0
- molde/render_widgets/common_render_widget.py +433 -0
- molde/stylesheets/__init__.py +119 -0
- molde/stylesheets/common.qss +16 -0
- molde/stylesheets/create_color_page.py +61 -0
- molde/stylesheets/mainwindow.ui +611 -0
- molde/stylesheets/qcheckbox.qss +19 -0
- molde/stylesheets/qinputs.qss +79 -0
- molde/stylesheets/qlayouts.qss +22 -0
- molde/stylesheets/qmenubar.qss +12 -0
- molde/stylesheets/qprogressbar.qss +12 -0
- molde/stylesheets/qpushbutton.qss +91 -0
- molde/stylesheets/qradiobutton.qss +31 -0
- molde/stylesheets/qscrollbar.qss +30 -0
- molde/stylesheets/qslider.qss +61 -0
- molde/stylesheets/qtablewidget.qss +27 -0
- molde/stylesheets/qtabwidget.qss +30 -0
- molde/stylesheets/qtoolbar.qss +62 -0
- molde/stylesheets/qtoolbuttons.qss +14 -0
- molde/stylesheets/qtreewidget.qss +25 -0
- molde/utils/__init__.py +8 -0
- molde/utils/format_sequences.py +44 -0
- molde/utils/poly_data_utils.py +25 -0
- molde/utils/tree_info.py +52 -0
- molde-0.1.0.dist-info/METADATA +44 -0
- molde-0.1.0.dist-info/RECORD +62 -0
- molde-0.1.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,79 @@
|
|
1
|
+
QLineEdit, QLineEdit::clear-button, QDoubleSpinBox, QSpinBox, QComboBox {
|
2
|
+
background-color: @input-color;
|
3
|
+
border: 1px solid @border-color;
|
4
|
+
border-radius: 5px;
|
5
|
+
padding: 4px 4px;
|
6
|
+
min-width: 40px;
|
7
|
+
min-height: 15px;
|
8
|
+
}
|
9
|
+
|
10
|
+
QLineEdit::disabled,
|
11
|
+
QSpinBox::disabled {
|
12
|
+
background-color: @disabled-background;
|
13
|
+
border: 0px;
|
14
|
+
color: @disabled-color;
|
15
|
+
}
|
16
|
+
|
17
|
+
QSpinBox::up-button,
|
18
|
+
QDoubleSpinBox::up-button {
|
19
|
+
background-image: url("@arrow-up-image-icon");
|
20
|
+
background-repeat: no-repeat;
|
21
|
+
background-position: center;
|
22
|
+
width: 15px;
|
23
|
+
height: 15px;
|
24
|
+
}
|
25
|
+
|
26
|
+
QSpinBox::up-button:hover,
|
27
|
+
QDoubleSpinBox::up-button:hover,
|
28
|
+
QSpinBox::down-button:hover,
|
29
|
+
QDoubleSpinBox::down-button:hover {
|
30
|
+
background-color: @hover-arrow-color;
|
31
|
+
border-radius: 2px;
|
32
|
+
}
|
33
|
+
|
34
|
+
QSpinBox::up-button:disabled,
|
35
|
+
QDoubleSpinBox::up-button:disabled {
|
36
|
+
background-image: url("@arrow-up-disabled-image-icon");
|
37
|
+
background-repeat: no-repeat;
|
38
|
+
background-position: center;
|
39
|
+
background-color: @disabled-background;
|
40
|
+
}
|
41
|
+
|
42
|
+
QSpinBox::down-button,
|
43
|
+
QDoubleSpinBox::down-button {
|
44
|
+
background-image: url("@arrow-down-image-icon");
|
45
|
+
background-repeat: no-repeat;
|
46
|
+
background-position: center;
|
47
|
+
width: 15px;
|
48
|
+
height: 15px;
|
49
|
+
}
|
50
|
+
|
51
|
+
QSpinBox::down-button:disabled,
|
52
|
+
QDoubleSpinBox::down-button:disabled {
|
53
|
+
background-image: url("@arrow-down-disabled-image-icon");
|
54
|
+
background-repeat: no-repeat;
|
55
|
+
background-position: center;
|
56
|
+
background-color: @disabled-background;
|
57
|
+
}
|
58
|
+
|
59
|
+
|
60
|
+
QComboBox::drop-down:button {
|
61
|
+
background-image: url("@arrow-down-image-icon");
|
62
|
+
background-repeat: no-repeat;
|
63
|
+
background-position: center;
|
64
|
+
background-color: @input-color;
|
65
|
+
border-radius: @border-radius;
|
66
|
+
}
|
67
|
+
|
68
|
+
QComboBox::drop-down:hover {
|
69
|
+
background-color: @hover-arrow-color;
|
70
|
+
}
|
71
|
+
|
72
|
+
QComboBox::drop-down:disabled {
|
73
|
+
background-color: @disabled-background;
|
74
|
+
}
|
75
|
+
|
76
|
+
QSpinBox,
|
77
|
+
QDoubleSpinBox {
|
78
|
+
border: 2px solid @background;
|
79
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
QFrame[frameShape="0"] {
|
2
|
+
border: none;
|
3
|
+
}
|
4
|
+
|
5
|
+
QFrame[frameShape="1"],
|
6
|
+
QFrame[frameShape="2"] {
|
7
|
+
border: 1px solid @border-color;
|
8
|
+
padding: 0;
|
9
|
+
}
|
10
|
+
|
11
|
+
QWidget QFrame[frameShape="1"],
|
12
|
+
QWidget QFrame[frameShape="2"] {
|
13
|
+
border: 1px solid @border-color;
|
14
|
+
border-radius: @border-radius;
|
15
|
+
padding: 0;
|
16
|
+
}
|
17
|
+
|
18
|
+
QFrame::disabled {
|
19
|
+
background: @background;
|
20
|
+
}
|
21
|
+
|
22
|
+
|
@@ -0,0 +1,12 @@
|
|
1
|
+
QProgressBar {
|
2
|
+
border-radius: 5px;
|
3
|
+
text-align: center;
|
4
|
+
background-color: @background-variant;
|
5
|
+
}
|
6
|
+
QProgressBar::chunk {
|
7
|
+
background-color: @primary;
|
8
|
+
border-top-right-radius: 3px;
|
9
|
+
border-top-left-radius: 3px;
|
10
|
+
border-bottom-right-radius: 3px;
|
11
|
+
border-bottom-left-radius: 3px;
|
12
|
+
}
|
@@ -0,0 +1,91 @@
|
|
1
|
+
QPushButton {
|
2
|
+
color: @primary;
|
3
|
+
background-color: @background;
|
4
|
+
border: 1px solid @border-color;
|
5
|
+
border-radius: 5px;
|
6
|
+
text-align: center;
|
7
|
+
padding: 4px 8px;
|
8
|
+
min-width: 50px;
|
9
|
+
}
|
10
|
+
|
11
|
+
QPushButton::hover {
|
12
|
+
background-color: @background-variant;
|
13
|
+
}
|
14
|
+
|
15
|
+
QPushButton::checked,
|
16
|
+
QPushButton::pressed {
|
17
|
+
background-color: @primary-lighter;
|
18
|
+
color: @primary-darker;
|
19
|
+
}
|
20
|
+
|
21
|
+
QPushButton::disabled {
|
22
|
+
background: @disabled-background;
|
23
|
+
color: @disabled-color;
|
24
|
+
}
|
25
|
+
|
26
|
+
QPushButton[status=main],
|
27
|
+
QPushButton::default {
|
28
|
+
border: 2px solid @primary;
|
29
|
+
border-radius: @border-radius;
|
30
|
+
color: @primary;
|
31
|
+
font-weight: bold;
|
32
|
+
}
|
33
|
+
|
34
|
+
QPushButton[status=main]::hover,
|
35
|
+
QPushButton::default:hover {
|
36
|
+
background-color: @background-variant;
|
37
|
+
}
|
38
|
+
|
39
|
+
QPushButton[status=main]::checked,
|
40
|
+
QPushButton[status=main]::pressed,
|
41
|
+
QPushButton::default:checked,
|
42
|
+
QPushButton::default:pressed {
|
43
|
+
background-color: @primary-lighter;
|
44
|
+
color: @primary-darker;
|
45
|
+
}
|
46
|
+
|
47
|
+
QPushButton[status=danger] {
|
48
|
+
border: 2px solid @danger-color;
|
49
|
+
border-radius: @border-radius;
|
50
|
+
color: @danger-color;
|
51
|
+
font-weight: bold;
|
52
|
+
}
|
53
|
+
|
54
|
+
QPushButton[status=danger]::hover {
|
55
|
+
background-color: @background-variant;
|
56
|
+
}
|
57
|
+
|
58
|
+
QPushButton[status=danger]::checked,
|
59
|
+
QPushButton[status=danger]::pressed {
|
60
|
+
background-color: @danger-color-lighter;
|
61
|
+
color: @danger-color-darker;
|
62
|
+
}
|
63
|
+
|
64
|
+
QPushButton[status=warning] {
|
65
|
+
border: 2px solid @warning-color;
|
66
|
+
border-radius: @border-radius;
|
67
|
+
color: @warning-color;
|
68
|
+
font-weight: bold;
|
69
|
+
}
|
70
|
+
|
71
|
+
QPushButton[status=warning]::hover {
|
72
|
+
background-color: @background-variant;
|
73
|
+
}
|
74
|
+
|
75
|
+
QPushButton[status=warning]::checked,
|
76
|
+
QPushButton[status=warning]::pressed {
|
77
|
+
background-color: @warning-color-lighter;
|
78
|
+
color: @warning-color-darker;
|
79
|
+
}
|
80
|
+
|
81
|
+
QPushButton[status=main]::disabled,
|
82
|
+
QPushButton[status=warning]::disabled,
|
83
|
+
QPushButton[status=danger]::disabled {
|
84
|
+
background-color: @disabled-background;
|
85
|
+
color: @disabled-color;
|
86
|
+
border: none;
|
87
|
+
}
|
88
|
+
|
89
|
+
QDialogButtonBox QPushButton {
|
90
|
+
min-width: 65px;
|
91
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
QRadioButton {
|
2
|
+
padding: 5px 10px;
|
3
|
+
}
|
4
|
+
|
5
|
+
QRadioButton::indicator {
|
6
|
+
width: 10px;
|
7
|
+
height: 10px;
|
8
|
+
border-radius: 6px;
|
9
|
+
border: 2px solid @primary;
|
10
|
+
background-color: @background;
|
11
|
+
}
|
12
|
+
|
13
|
+
QRadioButton::indicator:checked {
|
14
|
+
background-color: @primary;
|
15
|
+
border: 2px solid @primary;
|
16
|
+
}
|
17
|
+
|
18
|
+
QRadioButton::indicator:hover {
|
19
|
+
background-color: @primary;
|
20
|
+
}
|
21
|
+
|
22
|
+
QRadioButton::indicator:disabled {
|
23
|
+
background: @disabled-background;
|
24
|
+
border-color: @disabled-background;
|
25
|
+
}
|
26
|
+
|
27
|
+
QRadioButton::disabled {
|
28
|
+
background-color: @background;
|
29
|
+
color: @disabled-color;
|
30
|
+
|
31
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical,
|
2
|
+
QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal {
|
3
|
+
background: none;
|
4
|
+
background-color: @background-variant;
|
5
|
+
border: 2px solid @border-color;
|
6
|
+
}
|
7
|
+
|
8
|
+
QScrollBar::up-arrow {
|
9
|
+
background-image: url("@arrow-up-image-icon");
|
10
|
+
background-repeat: no-repeat;
|
11
|
+
background-position: center;
|
12
|
+
}
|
13
|
+
|
14
|
+
QScrollBar::down-arrow {
|
15
|
+
background-image: url("@arrow-down-image-icon");
|
16
|
+
background-repeat: no-repeat;
|
17
|
+
background-position: center;
|
18
|
+
}
|
19
|
+
|
20
|
+
QScrollBar::left-arrow {
|
21
|
+
background-image: url("@arrow-left-image-icon");
|
22
|
+
background-repeat: no-repeat;
|
23
|
+
background-position: center;
|
24
|
+
}
|
25
|
+
|
26
|
+
QScrollBar::right-arrow {
|
27
|
+
background-image: url("@arrow-right-image-icon");
|
28
|
+
background-repeat: no-repeat;
|
29
|
+
background-position: center;
|
30
|
+
}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
QSlider:horizontal {
|
2
|
+
padding: 4px 0;
|
3
|
+
}
|
4
|
+
|
5
|
+
QSlider:vertical {
|
6
|
+
padding: 0 4px;
|
7
|
+
}
|
8
|
+
|
9
|
+
QSlider::groove {
|
10
|
+
border-radius: 10px;
|
11
|
+
}
|
12
|
+
|
13
|
+
QSlider::groove:horizontal {
|
14
|
+
height: 4px;
|
15
|
+
}
|
16
|
+
|
17
|
+
QSlider::groove:vertical {
|
18
|
+
width: 4px;
|
19
|
+
}
|
20
|
+
|
21
|
+
QSlider::sub-page:horizontal,
|
22
|
+
QSlider::add-page:vertical,
|
23
|
+
QSlider::handle {
|
24
|
+
background: @primary;
|
25
|
+
}
|
26
|
+
|
27
|
+
QSlider::sub-page:horizontal:disabled,
|
28
|
+
QSlider::add-page:vertical:disabled,
|
29
|
+
QSlider::handle:disabled {
|
30
|
+
background: @disabled-background;
|
31
|
+
}
|
32
|
+
|
33
|
+
QSlider::add-page:horizontal,
|
34
|
+
QSlider::sub-page:vertical {
|
35
|
+
background: @background-variant;
|
36
|
+
}
|
37
|
+
|
38
|
+
QSlider::handle:hover,
|
39
|
+
QSlider::handle:pressed {
|
40
|
+
background: @primary-lighter;
|
41
|
+
}
|
42
|
+
|
43
|
+
QSlider::handle:horizontal {
|
44
|
+
width: 16px;
|
45
|
+
height: 8px;
|
46
|
+
margin: -6px 0;
|
47
|
+
border-radius: 8px;
|
48
|
+
}
|
49
|
+
|
50
|
+
QSlider::handle:vertical {
|
51
|
+
width: 8px;
|
52
|
+
height: 16px;
|
53
|
+
margin: 0 -6px;
|
54
|
+
border-radius: 8px;
|
55
|
+
}
|
56
|
+
|
57
|
+
QSlider::disabled {
|
58
|
+
background-color: @background;
|
59
|
+
}
|
60
|
+
|
61
|
+
|
@@ -0,0 +1,27 @@
|
|
1
|
+
QTableWidget:focus {
|
2
|
+
border: none;
|
3
|
+
}
|
4
|
+
|
5
|
+
QTableWidget::item {
|
6
|
+
background-color: none;
|
7
|
+
}
|
8
|
+
|
9
|
+
QTableWidget::item:selected {
|
10
|
+
background-color: @primary;
|
11
|
+
color: @on-primary;
|
12
|
+
}
|
13
|
+
|
14
|
+
QHeaderView::section {
|
15
|
+
background-color: @background-variant;
|
16
|
+
border: 1px solid @border-color;
|
17
|
+
}
|
18
|
+
|
19
|
+
QHeaderView::section:on:enabled {
|
20
|
+
color: @primary;
|
21
|
+
}
|
22
|
+
|
23
|
+
QTableCornerButton::section {
|
24
|
+
background-color: @background-variant;
|
25
|
+
padding: 5px 5px;
|
26
|
+
border: 1px solid @border-color;
|
27
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
QTabWidget::pane {
|
2
|
+
border: 1px solid @border-color;
|
3
|
+
background-color: @background-variant;
|
4
|
+
top:-1px;
|
5
|
+
}
|
6
|
+
|
7
|
+
QTabBar::tab {
|
8
|
+
background: @background-variant;
|
9
|
+
padding: 10px;
|
10
|
+
border: 1px solid @border-color;
|
11
|
+
}
|
12
|
+
|
13
|
+
QTabBar::tab:selected {
|
14
|
+
background: @background;
|
15
|
+
margin-bottom: -1px;
|
16
|
+
}
|
17
|
+
|
18
|
+
QTabBar::tab:hover {
|
19
|
+
background: @border-color;
|
20
|
+
}
|
21
|
+
|
22
|
+
QTabBar::tab:focus {
|
23
|
+
border: 2px solid @primary-darker;
|
24
|
+
border-bottom: 3px solid @primary-darker;
|
25
|
+
/* background-color: @primary; */
|
26
|
+
}
|
27
|
+
|
28
|
+
QTabWidget::pane:focus {
|
29
|
+
background-color: red;
|
30
|
+
}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
QToolBar {
|
2
|
+
padding: 1px;
|
3
|
+
spacing: 2px;
|
4
|
+
margin: 1px;
|
5
|
+
}
|
6
|
+
|
7
|
+
QToolBar::separator {
|
8
|
+
background-color: @background-variant;
|
9
|
+
}
|
10
|
+
|
11
|
+
QToolBar::separator:horizontal {
|
12
|
+
width: 2px;
|
13
|
+
margin: 0 6px;
|
14
|
+
}
|
15
|
+
|
16
|
+
QToolBar::separator:vertical {
|
17
|
+
height: 2px;
|
18
|
+
margin: 6px 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
QToolBar QLineEdit {
|
22
|
+
padding: 3px 4px;
|
23
|
+
border: 1px solid @background-variant;
|
24
|
+
border-radius: @border-radius;
|
25
|
+
background-color: @input-color;
|
26
|
+
height: 15px;
|
27
|
+
}
|
28
|
+
|
29
|
+
QToolBar QPushButton,
|
30
|
+
QToolBar QComboBox {
|
31
|
+
height: 15px;
|
32
|
+
}
|
33
|
+
|
34
|
+
/* QToolBar QLineEdit:disabled {
|
35
|
+
background-color: @disabled-color;
|
36
|
+
color: rgb(100, 100, 100)
|
37
|
+
}
|
38
|
+
*/
|
39
|
+
|
40
|
+
QToolBar QSlider:disabled {
|
41
|
+
background-color: @disabled-background;
|
42
|
+
}
|
43
|
+
|
44
|
+
QToolBar QPushButton {
|
45
|
+
min-width: 0px;
|
46
|
+
}
|
47
|
+
|
48
|
+
QToolBar QLabel {
|
49
|
+
margin: 2px;
|
50
|
+
}
|
51
|
+
|
52
|
+
QToolBar QSlider::sub-page:vertical:disabled,
|
53
|
+
QToolBar QSlider::add-page:horizontal:disabled,
|
54
|
+
QToolBar QSlider::handle:disabled {
|
55
|
+
background: @disabled-color;
|
56
|
+
}
|
57
|
+
|
58
|
+
QToolBar QFrame::disabled {
|
59
|
+
background: @disabled-background;
|
60
|
+
}
|
61
|
+
|
62
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
QToolButton{
|
2
|
+
padding: 4px;
|
3
|
+
border: none;
|
4
|
+
margin: 1px;
|
5
|
+
spacing: 10px;
|
6
|
+
border-radius: @border-radius;
|
7
|
+
}
|
8
|
+
|
9
|
+
QToolButton:hover,
|
10
|
+
QToolButton::menu-button:hover,
|
11
|
+
QToolButton::checked {
|
12
|
+
background: @background-variant;
|
13
|
+
border-radius: @border-radius;
|
14
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
QTreeView {
|
2
|
+
background-color: @background;
|
3
|
+
alternate-background-color: @background-variant;
|
4
|
+
}
|
5
|
+
|
6
|
+
QTreeView::branch:!selected:hover,
|
7
|
+
QTreeView::item:!selected:hover {
|
8
|
+
background-color: @primary-lighter;
|
9
|
+
color: @on-primary;
|
10
|
+
}
|
11
|
+
|
12
|
+
QTreeView::item:selected {
|
13
|
+
background-color: @primary;
|
14
|
+
border: 1px solid @border-color;
|
15
|
+
color: @on-primary;
|
16
|
+
}
|
17
|
+
|
18
|
+
QTreeWidget::branch:has-children:open {
|
19
|
+
background-image: url("@arrow-down-image-icon");
|
20
|
+
}
|
21
|
+
|
22
|
+
QTreeWidget::branch:has-children:closed {
|
23
|
+
background-image: url("@arrow-right-image-icon");
|
24
|
+
}
|
25
|
+
|
molde/utils/__init__.py
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
from .format_sequences import format_long_sequence
|
2
|
+
from .poly_data_utils import set_polydata_colors, set_polydata_property
|
3
|
+
from .tree_info import TreeInfo
|
4
|
+
|
5
|
+
|
6
|
+
from collections import defaultdict
|
7
|
+
def nested_dict() -> defaultdict:
|
8
|
+
return defaultdict(nested_dict)
|
@@ -0,0 +1,44 @@
|
|
1
|
+
from math import ceil, floor
|
2
|
+
|
3
|
+
|
4
|
+
def format_long_sequence(
|
5
|
+
sequence, max_width=30, max_lines=3, item_separator=", ", identation="► "
|
6
|
+
):
|
7
|
+
strings = [str(i) for i in sequence]
|
8
|
+
|
9
|
+
initial_lines = []
|
10
|
+
for _ in range(ceil(max_lines / 2)):
|
11
|
+
new_line = _extract_line(strings, max_width, len(item_separator))
|
12
|
+
if not new_line:
|
13
|
+
break
|
14
|
+
initial_lines.append(new_line)
|
15
|
+
strings = strings[len(new_line) :]
|
16
|
+
|
17
|
+
strings.reverse()
|
18
|
+
final_lines = []
|
19
|
+
for _ in range(floor(max_lines / 2)):
|
20
|
+
new_line = _extract_line(strings, max_width, len(item_separator))
|
21
|
+
if not new_line:
|
22
|
+
break
|
23
|
+
final_lines.append(new_line)
|
24
|
+
strings = strings[len(new_line) :]
|
25
|
+
final_lines.reverse()
|
26
|
+
|
27
|
+
if strings and initial_lines:
|
28
|
+
initial_lines[-1] = ["..."]
|
29
|
+
lines = initial_lines + final_lines
|
30
|
+
|
31
|
+
formated_lines = [item_separator.join(line) for line in lines]
|
32
|
+
concatenated_lines = identation + f"\n{identation}".join(formated_lines)
|
33
|
+
return concatenated_lines
|
34
|
+
|
35
|
+
|
36
|
+
def _extract_line(strings, max_width, separator_size):
|
37
|
+
line = []
|
38
|
+
current_width = 0
|
39
|
+
for string in strings:
|
40
|
+
if len(string) + current_width + separator_size > max_width:
|
41
|
+
break
|
42
|
+
line.append(string)
|
43
|
+
current_width += len(string) + separator_size
|
44
|
+
return line
|
@@ -0,0 +1,25 @@
|
|
1
|
+
from vtkmodules.vtkCommonCore import vtkUnsignedCharArray, vtkUnsignedIntArray
|
2
|
+
from vtkmodules.vtkCommonDataModel import vtkPolyData
|
3
|
+
|
4
|
+
|
5
|
+
def set_polydata_colors(data: vtkPolyData, color: tuple) -> vtkUnsignedCharArray:
|
6
|
+
n_cells = data.GetNumberOfCells()
|
7
|
+
cell_colors = vtkUnsignedCharArray()
|
8
|
+
cell_colors.SetName("colors")
|
9
|
+
cell_colors.SetNumberOfComponents(3)
|
10
|
+
cell_colors.SetNumberOfTuples(n_cells)
|
11
|
+
cell_colors.FillComponent(0, color[0])
|
12
|
+
cell_colors.FillComponent(1, color[1])
|
13
|
+
cell_colors.FillComponent(2, color[2])
|
14
|
+
data.GetCellData().SetScalars(cell_colors)
|
15
|
+
return cell_colors
|
16
|
+
|
17
|
+
|
18
|
+
def set_polydata_property(data: vtkPolyData, property_data: int, property_name: str) -> vtkUnsignedIntArray:
|
19
|
+
n_cells = data.GetNumberOfCells()
|
20
|
+
cell_identifier = vtkUnsignedIntArray()
|
21
|
+
cell_identifier.SetName(property_name)
|
22
|
+
cell_identifier.SetNumberOfTuples(n_cells)
|
23
|
+
cell_identifier.Fill(property_data)
|
24
|
+
data.GetCellData().AddArray(cell_identifier)
|
25
|
+
return cell_identifier
|
molde/utils/tree_info.py
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
from collections import namedtuple
|
2
|
+
|
3
|
+
TreeItem = namedtuple("TreeItem", ["name", "data", "unity"])
|
4
|
+
SEPARATOR = TreeItem("", "", "")
|
5
|
+
|
6
|
+
|
7
|
+
class TreeInfo:
|
8
|
+
def __init__(self, name: str) -> None:
|
9
|
+
self.name = name
|
10
|
+
self.items = list()
|
11
|
+
|
12
|
+
def add_separator(self):
|
13
|
+
self.items.append(TreeItem("", "", ""))
|
14
|
+
return TreeItem("", "", "")
|
15
|
+
|
16
|
+
def add_item(self, name, data, unity="") -> TreeItem:
|
17
|
+
item = TreeItem(name, data, unity)
|
18
|
+
self.items.append(item)
|
19
|
+
return item
|
20
|
+
|
21
|
+
def items_without_extra_separators(self):
|
22
|
+
extra_separators = 0
|
23
|
+
for item in reversed(self.items):
|
24
|
+
if item != SEPARATOR:
|
25
|
+
break
|
26
|
+
extra_separators += 1
|
27
|
+
return self.items[: len(self.items) - extra_separators]
|
28
|
+
|
29
|
+
def __str__(self):
|
30
|
+
title = self.name.upper()
|
31
|
+
longest_name = max(0, *[len(item.name) for item in self.items])
|
32
|
+
longest_data = max(0, *[len(str(item.data)) for item in self.items])
|
33
|
+
spaces = longest_name + longest_data + 3
|
34
|
+
|
35
|
+
text = f"{title} \n"
|
36
|
+
pruned_items = self.items_without_extra_separators()
|
37
|
+
|
38
|
+
for item in pruned_items[:-1]:
|
39
|
+
if item == SEPARATOR:
|
40
|
+
text += "│\n"
|
41
|
+
continue
|
42
|
+
spacer = " " * (spaces - len(item.name) - len(str(item.data)))
|
43
|
+
unity = f"[{item.unity}]" if item.unity else ""
|
44
|
+
text += f"├─ {item.name}: {spacer}{item.data} {unity}\n"
|
45
|
+
|
46
|
+
# last item
|
47
|
+
item = pruned_items[-1]
|
48
|
+
spacer = " " * (spaces - len(item.name) - len(str(item.data)))
|
49
|
+
unity = f"[{item.unity}]" if item.unity else ""
|
50
|
+
text += f"╰─ {item.name}: {spacer}{item.data} {unity}\n"
|
51
|
+
text += "\n"
|
52
|
+
return text
|
@@ -0,0 +1,44 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: molde
|
3
|
+
Version: 0.1.0
|
4
|
+
Summary:
|
5
|
+
Author: André Fernandes
|
6
|
+
Author-email: fpf.andre@gmail.com
|
7
|
+
Requires-Python: >=3.10
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
9
|
+
Classifier: Programming Language :: Python :: 3.10
|
10
|
+
Classifier: Programming Language :: Python :: 3.11
|
11
|
+
Requires-Dist: moviepy (>=1.0.3,<2.0.0)
|
12
|
+
Requires-Dist: numpy (>=2.1.2,<3.0.0)
|
13
|
+
Requires-Dist: pyqt5 (>=5.15.10,<6.0.0)
|
14
|
+
Requires-Dist: pyqt5-qt5 (==5.15.2)
|
15
|
+
Requires-Dist: vtk (>=9.3.1,<10.0.0)
|
16
|
+
Description-Content-Type: text/markdown
|
17
|
+
|
18
|
+
<div align="center">
|
19
|
+
<img height="90" src="logos/mold_horizontal_logo_dark_300dpi.png" alt="Logo" align="center">
|
20
|
+
</div>
|
21
|
+
|
22
|
+
# MOLDE
|
23
|
+
**M**OPT **L**ightweight **De**esign (MOLDE) is a library created to standardize and make easier the creation and maintainance of internal products of the Multidisciplinary Optimization Group (MOPT).
|
24
|
+
|
25
|
+
Here are the colors, icons, fonts and common interface components, that may be usefull for multiple MOPT projects.
|
26
|
+
|
27
|
+
This is heavily inspired by [Carbon Design System](https://carbondesignsystem.com/), [Atlassian Design System](https://atlassian.design/), [Fast Design System](https://www.fast.design/), [Material Design](https://m3.material.io/) and [Bold Design System](https://bold.bridge.ufsc.br/pt/).
|
28
|
+
|
29
|
+
# Colors
|
30
|
+
The color palettes are available [here](https://andrefpf.github.io/molde/).
|
31
|
+
|
32
|
+
# Icons
|
33
|
+
A lot of free to use icons, from Material Design, are available [here](https://fonts.google.com/icons).
|
34
|
+
Other icons may be necessary, and they will be made to match the same style.
|
35
|
+
For consistency avoid using icons from other places.
|
36
|
+
|
37
|
+
# Typeface
|
38
|
+
The font choose for this system is [IBM Plex](https://www.ibm.com/plex/).
|
39
|
+
The `.ttf` files for every version of the font, including monospaced, can be found [here](https://github.com/IBM/plex/tree/master/packages).
|
40
|
+
|
41
|
+
# Component
|
42
|
+
The sylesheets of the Qt components are designed to make it similar to [Atlassian components](https://atlassian.design/components/).
|
43
|
+
Always check for the Atlassian component usage guide in case of any doubt.
|
44
|
+
|