MoleditPy 2.4.6__tar.gz → 2.4.7__tar.gz
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-2.4.6 → moleditpy-2.4.7}/PKG-INFO +1 -1
- {moleditpy-2.4.6 → moleditpy-2.4.7}/pyproject.toml +1 -1
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/MoleditPy.egg-info/PKG-INFO +1 -1
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/bond_item.py +34 -27
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/constants.py +1 -1
- {moleditpy-2.4.6 → moleditpy-2.4.7}/LICENSE +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/README.md +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/setup.cfg +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/MoleditPy.egg-info/SOURCES.txt +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/MoleditPy.egg-info/dependency_links.txt +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/MoleditPy.egg-info/entry_points.txt +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/MoleditPy.egg-info/requires.txt +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/MoleditPy.egg-info/top_level.txt +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/__init__.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/__main__.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/main.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/__init__.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/about_dialog.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/align_plane_dialog.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/alignment_dialog.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/analysis_window.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/angle_dialog.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/assets/file_icon.ico +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/assets/icon.icns +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/assets/icon.ico +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/assets/icon.png +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/atom_item.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/bond_length_dialog.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/calculation_worker.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/color_settings_dialog.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/constrained_optimization_dialog.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/custom_interactor_style.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/custom_qt_interactor.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/dialog3_d_picking_mixin.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/dihedral_dialog.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/main_window.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/main_window_app_state.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/main_window_compute.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/main_window_dialog_manager.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/main_window_edit_3d.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/main_window_edit_actions.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/main_window_export.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/main_window_main_init.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/main_window_molecular_parsers.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/main_window_project_io.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/main_window_string_importers.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/main_window_ui_manager.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/main_window_view_3d.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/main_window_view_loaders.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/mirror_dialog.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/molecular_data.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/molecule_scene.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/move_group_dialog.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/periodic_table_dialog.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/planarize_dialog.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/plugin_interface.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/plugin_manager.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/plugin_manager_window.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/settings_dialog.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/template_preview_item.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/template_preview_view.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/translation_dialog.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/user_template_dialog.py +0 -0
- {moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/zoomable_view.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: MoleditPy
|
|
3
|
-
Version: 2.4.
|
|
3
|
+
Version: 2.4.7
|
|
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
|
License: GNU GENERAL PUBLIC LICENSE
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: MoleditPy
|
|
3
|
-
Version: 2.4.
|
|
3
|
+
Version: 2.4.7
|
|
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
|
License: GNU GENERAL PUBLIC LICENSE
|
|
@@ -164,43 +164,50 @@ class BondItem(QGraphicsItem):
|
|
|
164
164
|
return rect
|
|
165
165
|
|
|
166
166
|
def shape(self):
|
|
167
|
+
"""Define the precise collision/selection area, separate from the drawing area (boundingRect)."""
|
|
167
168
|
path = QPainterPath()
|
|
168
169
|
try:
|
|
169
170
|
line = self.get_line_in_local_coords()
|
|
171
|
+
# Create a simple path along the bond line
|
|
172
|
+
path.moveTo(line.p1())
|
|
173
|
+
path.lineTo(line.p2())
|
|
174
|
+
|
|
175
|
+
# Stroke it to give it some width (e.g., 10px or dynamic based on settings) generally easier to click
|
|
176
|
+
# even if the visual width is smaller.
|
|
177
|
+
stroker = QPainterPathStroker()
|
|
178
|
+
stroker.setWidth(DESIRED_BOND_PIXEL_WIDTH) # Use constant (20.0)
|
|
179
|
+
path = stroker.createStroke(path)
|
|
180
|
+
|
|
181
|
+
# If there's an E/Z label, add its rect to the selection shape
|
|
182
|
+
label_rect = self.get_ez_label_local_rect()
|
|
183
|
+
if label_rect:
|
|
184
|
+
path.addRect(label_rect)
|
|
185
|
+
|
|
170
186
|
except Exception:
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
scene = self.scene()
|
|
176
|
-
if not scene or not scene.views():
|
|
177
|
-
return super().shape()
|
|
178
|
-
|
|
179
|
-
view = scene.views()[0]
|
|
180
|
-
scale = view.transform().m11()
|
|
187
|
+
# Fallback to a small rect around the origin if calculation fails
|
|
188
|
+
path.addRect(QRectF(-5, -5, 10, 10))
|
|
189
|
+
|
|
190
|
+
return path
|
|
181
191
|
|
|
182
|
-
|
|
183
|
-
|
|
192
|
+
def get_ez_label_local_rect(self):
|
|
193
|
+
"""Helper to get E/Z label rect in local coordinates."""
|
|
194
|
+
if self.order != 2 or self.stereo not in [3, 4]:
|
|
195
|
+
return None
|
|
184
196
|
try:
|
|
185
|
-
|
|
186
|
-
|
|
197
|
+
line = self.get_line_in_local_coords()
|
|
198
|
+
center = line.center()
|
|
199
|
+
|
|
200
|
+
# Logic similar to boundingRect but returning just the label box
|
|
201
|
+
font_size = 20
|
|
202
|
+
# ... (Simpler logic: just return a box around center)
|
|
203
|
+
# Standard size estimate
|
|
204
|
+
box_size = 30
|
|
205
|
+
return QRectF(center.x() - box_size/2, center.y() - box_size/2, box_size, box_size)
|
|
187
206
|
except Exception:
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
# Hit area should be roughly closely matched or slightly larger than visual
|
|
191
|
-
# Ensure minimum hit width for usability
|
|
192
|
-
scene_width = max(DESIRED_BOND_PIXEL_WIDTH, width_2d * 10) / scale
|
|
207
|
+
return None
|
|
193
208
|
|
|
194
209
|
|
|
195
|
-
stroker = QPainterPathStroker()
|
|
196
|
-
stroker.setWidth(scene_width)
|
|
197
|
-
stroker.setCapStyle(Qt.PenCapStyle.RoundCap)
|
|
198
|
-
stroker.setJoinStyle(Qt.PenJoinStyle.RoundJoin)
|
|
199
210
|
|
|
200
|
-
center_line_path = QPainterPath(line.p1())
|
|
201
|
-
center_line_path.lineTo(line.p2())
|
|
202
|
-
|
|
203
|
-
return stroker.createStroke(center_line_path)
|
|
204
211
|
|
|
205
212
|
def paint(self, painter, option, widget):
|
|
206
213
|
if self.atom1 is None or self.atom2 is None:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{moleditpy-2.4.6 → moleditpy-2.4.7}/src/moleditpy/modules/constrained_optimization_dialog.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|