MoleditPy-linux 1.15.1__py3-none-any.whl → 1.16.1__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.
- moleditpy_linux/__init__.py +4 -0
- moleditpy_linux/__main__.py +29 -19742
- moleditpy_linux/main.py +37 -0
- moleditpy_linux/modules/__init__.py +29 -0
- moleditpy_linux/modules/about_dialog.py +92 -0
- moleditpy_linux/modules/align_plane_dialog.py +281 -0
- moleditpy_linux/modules/alignment_dialog.py +261 -0
- moleditpy_linux/modules/analysis_window.py +197 -0
- moleditpy_linux/modules/angle_dialog.py +428 -0
- moleditpy_linux/modules/assets/icon.icns +0 -0
- moleditpy_linux/modules/atom_item.py +336 -0
- moleditpy_linux/modules/bond_item.py +303 -0
- moleditpy_linux/modules/bond_length_dialog.py +368 -0
- moleditpy_linux/modules/calculation_worker.py +754 -0
- moleditpy_linux/modules/color_settings_dialog.py +309 -0
- moleditpy_linux/modules/constants.py +76 -0
- moleditpy_linux/modules/constrained_optimization_dialog.py +667 -0
- moleditpy_linux/modules/custom_interactor_style.py +737 -0
- moleditpy_linux/modules/custom_qt_interactor.py +49 -0
- moleditpy_linux/modules/dialog3_d_picking_mixin.py +96 -0
- moleditpy_linux/modules/dihedral_dialog.py +431 -0
- moleditpy_linux/modules/main_window.py +830 -0
- moleditpy_linux/modules/main_window_app_state.py +747 -0
- moleditpy_linux/modules/main_window_compute.py +1203 -0
- moleditpy_linux/modules/main_window_dialog_manager.py +454 -0
- moleditpy_linux/modules/main_window_edit_3d.py +531 -0
- moleditpy_linux/modules/main_window_edit_actions.py +1449 -0
- moleditpy_linux/modules/main_window_export.py +744 -0
- moleditpy_linux/modules/main_window_main_init.py +1665 -0
- moleditpy_linux/modules/main_window_molecular_parsers.py +956 -0
- moleditpy_linux/modules/main_window_project_io.py +429 -0
- moleditpy_linux/modules/main_window_string_importers.py +270 -0
- moleditpy_linux/modules/main_window_ui_manager.py +567 -0
- moleditpy_linux/modules/main_window_view_3d.py +1163 -0
- moleditpy_linux/modules/main_window_view_loaders.py +350 -0
- moleditpy_linux/modules/mirror_dialog.py +110 -0
- moleditpy_linux/modules/molecular_data.py +290 -0
- moleditpy_linux/modules/molecule_scene.py +1895 -0
- moleditpy_linux/modules/move_group_dialog.py +586 -0
- moleditpy_linux/modules/periodic_table_dialog.py +72 -0
- moleditpy_linux/modules/planarize_dialog.py +209 -0
- moleditpy_linux/modules/settings_dialog.py +1034 -0
- moleditpy_linux/modules/template_preview_item.py +148 -0
- moleditpy_linux/modules/template_preview_view.py +62 -0
- moleditpy_linux/modules/translation_dialog.py +353 -0
- moleditpy_linux/modules/user_template_dialog.py +621 -0
- moleditpy_linux/modules/zoomable_view.py +98 -0
- {moleditpy_linux-1.15.1.dist-info → moleditpy_linux-1.16.1.dist-info}/METADATA +1 -2
- moleditpy_linux-1.16.1.dist-info/RECORD +54 -0
- moleditpy_linux-1.15.1.dist-info/RECORD +0 -9
- /moleditpy_linux/{assets → modules/assets}/icon.ico +0 -0
- /moleditpy_linux/{assets → modules/assets}/icon.png +0 -0
- {moleditpy_linux-1.15.1.dist-info → moleditpy_linux-1.16.1.dist-info}/WHEEL +0 -0
- {moleditpy_linux-1.15.1.dist-info → moleditpy_linux-1.16.1.dist-info}/entry_points.txt +0 -0
- {moleditpy_linux-1.15.1.dist-info → moleditpy_linux-1.16.1.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
from PyQt6.QtWidgets import (
|
|
2
|
+
QGraphicsView
|
|
3
|
+
)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
from PyQt6.QtCore import (
|
|
8
|
+
Qt, QPointF
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
class ZoomableView(QGraphicsView):
|
|
12
|
+
""" マウスホイールでのズームと、中ボタン or Shift+左ドラッグでのパン機能を追加したQGraphicsView """
|
|
13
|
+
def __init__(self, scene, parent=None):
|
|
14
|
+
super().__init__(scene, parent)
|
|
15
|
+
self.setTransformationAnchor(QGraphicsView.ViewportAnchor.AnchorUnderMouse)
|
|
16
|
+
self.setResizeAnchor(QGraphicsView.ViewportAnchor.AnchorViewCenter)
|
|
17
|
+
self.setVerticalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAlwaysOn)
|
|
18
|
+
self.setHorizontalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAlwaysOn)
|
|
19
|
+
self.setDragMode(QGraphicsView.DragMode.NoDrag)
|
|
20
|
+
|
|
21
|
+
self.main_window = parent
|
|
22
|
+
self.setAcceptDrops(False)
|
|
23
|
+
|
|
24
|
+
self._is_panning = False
|
|
25
|
+
self._pan_start_pos = QPointF()
|
|
26
|
+
self._pan_start_scroll_h = 0
|
|
27
|
+
self._pan_start_scroll_v = 0
|
|
28
|
+
|
|
29
|
+
def wheelEvent(self, event):
|
|
30
|
+
""" マウスホイールを回した際のイベント """
|
|
31
|
+
if event.modifiers() & Qt.KeyboardModifier.ControlModifier:
|
|
32
|
+
zoom_in_factor = 1.1
|
|
33
|
+
zoom_out_factor = 1 / zoom_in_factor
|
|
34
|
+
|
|
35
|
+
transform = self.transform()
|
|
36
|
+
current_scale = transform.m11()
|
|
37
|
+
min_scale, max_scale = 0.05, 20.0
|
|
38
|
+
|
|
39
|
+
if event.angleDelta().y() > 0:
|
|
40
|
+
if max_scale > current_scale:
|
|
41
|
+
self.scale(zoom_in_factor, zoom_in_factor)
|
|
42
|
+
else:
|
|
43
|
+
if min_scale < current_scale:
|
|
44
|
+
self.scale(zoom_out_factor, zoom_out_factor)
|
|
45
|
+
|
|
46
|
+
event.accept()
|
|
47
|
+
else:
|
|
48
|
+
super().wheelEvent(event)
|
|
49
|
+
|
|
50
|
+
def mousePressEvent(self, event):
|
|
51
|
+
""" 中ボタン or Shift+左ボタンが押されたらパン(視点移動)モードを開始 """
|
|
52
|
+
is_middle_button = event.button() == Qt.MouseButton.MiddleButton
|
|
53
|
+
is_shift_left_button = (event.button() == Qt.MouseButton.LeftButton and
|
|
54
|
+
event.modifiers() & Qt.KeyboardModifier.ShiftModifier)
|
|
55
|
+
|
|
56
|
+
if is_middle_button or is_shift_left_button:
|
|
57
|
+
self._is_panning = True
|
|
58
|
+
self._pan_start_pos = event.pos() # ビューポート座標で開始点を記録
|
|
59
|
+
# 現在のスクロールバーの位置を記録
|
|
60
|
+
self._pan_start_scroll_h = self.horizontalScrollBar().value()
|
|
61
|
+
self._pan_start_scroll_v = self.verticalScrollBar().value()
|
|
62
|
+
self.setCursor(Qt.CursorShape.ClosedHandCursor)
|
|
63
|
+
event.accept()
|
|
64
|
+
else:
|
|
65
|
+
super().mousePressEvent(event)
|
|
66
|
+
|
|
67
|
+
def mouseMoveEvent(self, event):
|
|
68
|
+
""" パンモード中にマウスを動かしたら、スクロールバーを操作して視点を移動させる """
|
|
69
|
+
if self._is_panning:
|
|
70
|
+
delta = event.pos() - self._pan_start_pos # マウスの移動量を計算
|
|
71
|
+
# 開始時のスクロール位置から移動量を引いた値を新しいスクロール位置に設定
|
|
72
|
+
self.horizontalScrollBar().setValue(self._pan_start_scroll_h - delta.x())
|
|
73
|
+
self.verticalScrollBar().setValue(self._pan_start_scroll_v - delta.y())
|
|
74
|
+
event.accept()
|
|
75
|
+
else:
|
|
76
|
+
super().mouseMoveEvent(event)
|
|
77
|
+
|
|
78
|
+
def mouseReleaseEvent(self, event):
|
|
79
|
+
""" パンに使用したボタンが離されたらパンモードを終了 """
|
|
80
|
+
# パンを開始したボタン(中 or 左)のどちらかが離されたかをチェック
|
|
81
|
+
is_middle_button_release = event.button() == Qt.MouseButton.MiddleButton
|
|
82
|
+
is_left_button_release = event.button() == Qt.MouseButton.LeftButton
|
|
83
|
+
|
|
84
|
+
if self._is_panning and (is_middle_button_release or is_left_button_release):
|
|
85
|
+
self._is_panning = False
|
|
86
|
+
# 現在の描画モードに応じたカーソルに戻す
|
|
87
|
+
current_mode = self.scene().mode if self.scene() else 'select'
|
|
88
|
+
if current_mode == 'select':
|
|
89
|
+
self.setCursor(Qt.CursorShape.ArrowCursor)
|
|
90
|
+
elif current_mode.startswith(('atom', 'bond', 'template')):
|
|
91
|
+
self.setCursor(Qt.CursorShape.CrossCursor)
|
|
92
|
+
elif current_mode.startswith(('charge', 'radical')):
|
|
93
|
+
self.setCursor(Qt.CursorShape.CrossCursor)
|
|
94
|
+
else:
|
|
95
|
+
self.setCursor(Qt.CursorShape.ArrowCursor)
|
|
96
|
+
event.accept()
|
|
97
|
+
else:
|
|
98
|
+
super().mouseReleaseEvent(event)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: MoleditPy-linux
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.16.1
|
|
4
4
|
Summary: A cross-platform, simple, and intuitive molecular structure editor built in Python. It allows 2D molecular drawing and 3D structure visualization. It supports exporting structure files for input to DFT calculation software.
|
|
5
5
|
Author-email: HiroYokoyama <titech.yoko.hiro@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/HiroYokoyama/python_molecular_editor
|
|
@@ -15,7 +15,6 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.12
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
19
18
|
Requires-Python: <3.14,>=3.9
|
|
20
19
|
Description-Content-Type: text/markdown
|
|
21
20
|
Requires-Dist: numpy
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
moleditpy_linux/__init__.py,sha256=QCzpw3P5V_CwDtN4itK4hT9J99JgsH4gmpTfvuus6p8,46
|
|
2
|
+
moleditpy_linux/__main__.py,sha256=az0UrbFsuprbQYycF_bSUXxb0F20DuLvYxrZl1-X5EU,831
|
|
3
|
+
moleditpy_linux/main.py,sha256=cEZJuCL0HrLPUYvuwPSxgUkaDykVb573A-3qVvjF9RM,1180
|
|
4
|
+
moleditpy_linux/modules/__init__.py,sha256=DIO4nzCCnpeYLjFqzHxcRYqbECtWWMEGQ_-sb03jirs,1127
|
|
5
|
+
moleditpy_linux/modules/about_dialog.py,sha256=_M-8MLGXCDtVd7NW8xtglASOiIWTF7HzO8J8AzMubs0,3419
|
|
6
|
+
moleditpy_linux/modules/align_plane_dialog.py,sha256=D6E0_rM75rKirDkvkJ-diRqNkf8IguqBBLQqDvZJHME,11665
|
|
7
|
+
moleditpy_linux/modules/alignment_dialog.py,sha256=tS2_5-wnJRDhLcWtPm9-HUm4_v4bAr53EjV82vydA-k,11140
|
|
8
|
+
moleditpy_linux/modules/analysis_window.py,sha256=asSCm7bgDW00tGaXSwEN17j-de_BN7ql6iwmxb3f54E,9134
|
|
9
|
+
moleditpy_linux/modules/angle_dialog.py,sha256=_xwp8CyBEB309UEY618o065Hfqx-XZQHYFXa0fYeNNs,17548
|
|
10
|
+
moleditpy_linux/modules/atom_item.py,sha256=NSRO4x_5Ciq1Hnt2lfdjtVGGjuZ6iUt2bZ8NGT9FqIg,15297
|
|
11
|
+
moleditpy_linux/modules/bond_item.py,sha256=zjQHa4vb8xhS9B7cYPRM0nak-f7lr5NQ1uAj_J78ah4,12778
|
|
12
|
+
moleditpy_linux/modules/bond_length_dialog.py,sha256=xlx-bU3tVeLfShdVRw6_Geo5Gl9mztlIfTdT9tJ6WMA,14579
|
|
13
|
+
moleditpy_linux/modules/calculation_worker.py,sha256=detE48BW08a2tvmKjMgz8zCShgARzsRH-ABmWrPcqZA,42055
|
|
14
|
+
moleditpy_linux/modules/color_settings_dialog.py,sha256=h4AOKU8dCTenecI8zOM9GfnmKDm7jfe5C4Fa23Budvs,15205
|
|
15
|
+
moleditpy_linux/modules/constants.py,sha256=LXRej--b5v1JadEX63TDXvO8oalwVNWArkz732Q_-ME,4434
|
|
16
|
+
moleditpy_linux/modules/constrained_optimization_dialog.py,sha256=MlWnPze0JJvnqmHx9n3qZWG_h-2kZymT0PQ6lALbCro,29861
|
|
17
|
+
moleditpy_linux/modules/custom_interactor_style.py,sha256=K_uGM6FezY0kZ3zPqoR6f0nowG40ytt-L4UCAbPlwGM,38184
|
|
18
|
+
moleditpy_linux/modules/custom_qt_interactor.py,sha256=6mzaVb3Mhp-4nryG5AraEvPPgBJpotrzVYwrpCAKmVo,2186
|
|
19
|
+
moleditpy_linux/modules/dialog3_d_picking_mixin.py,sha256=gaF1ATevvvF72aBfAjubRcagT2jnVG5RMpEKos_XdKg,4768
|
|
20
|
+
moleditpy_linux/modules/dihedral_dialog.py,sha256=H6WFvc7NvPHSd5QCMk0NUPhudOzpModXv-42dYL20KM,17809
|
|
21
|
+
moleditpy_linux/modules/main_window.py,sha256=Ii36JTPSkZNaqqEc8CXZ1bq9accIMg5yUs1U7_pHgYM,35791
|
|
22
|
+
moleditpy_linux/modules/main_window_app_state.py,sha256=f9f3JVuC46ijlea2DR8ADa0Jn5r2dgedPPdg8OkmNAU,33374
|
|
23
|
+
moleditpy_linux/modules/main_window_compute.py,sha256=fiIokVvjzXIwwR3FV3Ltet_K4oL_rT0Z27rPMbvlyyc,51346
|
|
24
|
+
moleditpy_linux/modules/main_window_dialog_manager.py,sha256=5WU6mFABB0aI4XCywP-cLFPkNQSb3bC0OK0I28SQG_w,19845
|
|
25
|
+
moleditpy_linux/modules/main_window_edit_3d.py,sha256=FStBWVeDVAM2MoO-JCTjPM-G7iT8QZUHxsb0dS4MEAI,19553
|
|
26
|
+
moleditpy_linux/modules/main_window_edit_actions.py,sha256=8tR0rYfgWYgdKTxBP4snzpxhiD2DExSKyf4jzSWb6sE,64598
|
|
27
|
+
moleditpy_linux/modules/main_window_export.py,sha256=f_Z4qVYKBTe06lGTFqjd3deluUdkQvHhZYa81h7UpBM,34465
|
|
28
|
+
moleditpy_linux/modules/main_window_main_init.py,sha256=xAstCr__601hkbb1IpqpQKUFTSS6quYe66sBOgqJjkc,75228
|
|
29
|
+
moleditpy_linux/modules/main_window_molecular_parsers.py,sha256=8JAIgr1axzmJqX_Ue-Adkl8e_8B2Th9yutQbau8EEWQ,43401
|
|
30
|
+
moleditpy_linux/modules/main_window_project_io.py,sha256=2ArkW23L4ahQIiktCCXlNsJphU0awO5YzJGihIJsn1c,17021
|
|
31
|
+
moleditpy_linux/modules/main_window_string_importers.py,sha256=yrZblvPG840qnqVEJf__XVfNnWl_r3vt68Abfs2aYDQ,10674
|
|
32
|
+
moleditpy_linux/modules/main_window_ui_manager.py,sha256=0jdTZGv5JRtDlDniblPKzLPXdfUBZ3qh12s6pav4ihI,22038
|
|
33
|
+
moleditpy_linux/modules/main_window_view_3d.py,sha256=aU6fI-ZYUV7qOQmucsF5WuafGYyvb4P2xj0oIgsnDaU,55443
|
|
34
|
+
moleditpy_linux/modules/main_window_view_loaders.py,sha256=WuzLCYC22eaDFIvUvRtXgULZb-n4B04gcdgSKqTgWGA,14234
|
|
35
|
+
moleditpy_linux/modules/mirror_dialog.py,sha256=wYlnqrxAZfsADB5Gvabe-MoX3j0_NjfmWPyf3GCYj9U,4427
|
|
36
|
+
moleditpy_linux/modules/molecular_data.py,sha256=OCdiRIDXgnqYCKmf56x6XfbOJYTEQjY-MtBfnYZtTWY,12981
|
|
37
|
+
moleditpy_linux/modules/molecule_scene.py,sha256=F7W7HLctfqbtM0gI76fcyEar6Q5t_rWoy1cAPUTYrMg,90222
|
|
38
|
+
moleditpy_linux/modules/move_group_dialog.py,sha256=MVVdy0R-HIHcsCWD2yBVDWoDN4NFXPkOc72dq9laBP4,26905
|
|
39
|
+
moleditpy_linux/modules/periodic_table_dialog.py,sha256=slh1X-6YidaQGzQamrKJ6aetIMKTQLRlBfaAH6B6qfw,3737
|
|
40
|
+
moleditpy_linux/modules/planarize_dialog.py,sha256=u8IZGUEIXnVrBOXBqJefQpFqz3wiU6oLXp4gBNcC7Iw,8402
|
|
41
|
+
moleditpy_linux/modules/settings_dialog.py,sha256=ylofChBPAvUH-wkn_UGNqinYkKoEQKULis8i80Wzh9Y,58264
|
|
42
|
+
moleditpy_linux/modules/template_preview_item.py,sha256=KDuLEZpPSMm9ZB0z5ms8LZyHbFKvszemG0XnR5vi0qg,6404
|
|
43
|
+
moleditpy_linux/modules/template_preview_view.py,sha256=AXUaFJR0E1yX9dBY9IDbxYNsBTcRFZWnDwpS_pRZXhs,3081
|
|
44
|
+
moleditpy_linux/modules/translation_dialog.py,sha256=gIG_mz4wc4y4ZNq02Ql33ek6B-DrOf1pdWF3FsViCT4,14394
|
|
45
|
+
moleditpy_linux/modules/user_template_dialog.py,sha256=VhLh7MNbElySnAIHjkiRaYLRHJLeK-NcHtAX5yqjBzI,27955
|
|
46
|
+
moleditpy_linux/modules/zoomable_view.py,sha256=ZgAmmWXIKtx7AhMjs6H6PCyvb_kpYuankf8UxsZX9mg,4569
|
|
47
|
+
moleditpy_linux/modules/assets/icon.icns,sha256=wD5R6-Vw7K662tVKhu2E1ImN0oUuyAP4youesEQsn9c,139863
|
|
48
|
+
moleditpy_linux/modules/assets/icon.ico,sha256=RfgFcx7-dHY_2STdsOQCQziY5SNhDr3gPnjO6jzEDPI,147975
|
|
49
|
+
moleditpy_linux/modules/assets/icon.png,sha256=kCFN1WacYIdy0GN6SFEbNA00ef39pCczBnFdkkBI8Bs,147110
|
|
50
|
+
moleditpy_linux-1.16.1.dist-info/METADATA,sha256=bDyY5fIiGQmeGSv1iDg3GqsRDNsGTL7ZNYUk2V3AcL0,17435
|
|
51
|
+
moleditpy_linux-1.16.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
52
|
+
moleditpy_linux-1.16.1.dist-info/entry_points.txt,sha256=-OzipSi__yVwlimNtu3eiRP5t5UMg55Cs0udyhXYiyw,60
|
|
53
|
+
moleditpy_linux-1.16.1.dist-info/top_level.txt,sha256=qyqe-hDYL6CXyin9E5Me5rVl3PG84VqiOjf9bQvfJLs,16
|
|
54
|
+
moleditpy_linux-1.16.1.dist-info/RECORD,,
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
moleditpy_linux/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
moleditpy_linux/__main__.py,sha256=m_rHYAZXASskK4Vb8EGI_5s-dQPWiXuEWyEi9Vi7MFU,911252
|
|
3
|
-
moleditpy_linux/assets/icon.ico,sha256=RfgFcx7-dHY_2STdsOQCQziY5SNhDr3gPnjO6jzEDPI,147975
|
|
4
|
-
moleditpy_linux/assets/icon.png,sha256=kCFN1WacYIdy0GN6SFEbNA00ef39pCczBnFdkkBI8Bs,147110
|
|
5
|
-
moleditpy_linux-1.15.1.dist-info/METADATA,sha256=rKe9swL4-ZpM2HyrlKTTiCghNENzZoiIKdHPEOyj3C0,17499
|
|
6
|
-
moleditpy_linux-1.15.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
7
|
-
moleditpy_linux-1.15.1.dist-info/entry_points.txt,sha256=-OzipSi__yVwlimNtu3eiRP5t5UMg55Cs0udyhXYiyw,60
|
|
8
|
-
moleditpy_linux-1.15.1.dist-info/top_level.txt,sha256=qyqe-hDYL6CXyin9E5Me5rVl3PG84VqiOjf9bQvfJLs,16
|
|
9
|
-
moleditpy_linux-1.15.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|