mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Geometry: Profiles: Fix shift methode.
This commit is contained in:
1 parent
3a3b5ea2dd
commit
64d2b2678a
5 files changed
+13
-14
No files matched your search
@@ -338,6 +338,13 @@ class PointXYZ(Point):
|
||||
self._z = float(value)
|
||||
self.modified()
|
||||
|
||||
def shift(self, x, y, z):
|
||||
self.x += x
|
||||
self.y += y
|
||||
self.z += z
|
||||
|
||||
self.modified()
|
||||
|
||||
def get_coordinate(self):
|
||||
return (self._x, self._y, self._z)
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ from typing import List
|
||||
from functools import reduce
|
||||
from dataclasses import dataclass
|
||||
|
||||
from tools import timer, flatten
|
||||
from tools import trace, timer, flatten
|
||||
from shapely import geometry
|
||||
|
||||
from Model.Tools.PamhyrDB import SQLSubModel
|
||||
@@ -1073,16 +1073,10 @@ class ProfileXYZ(Profile, SQLSubModel):
|
||||
|
||||
def shift(self, x, y, z):
|
||||
for p in self._points:
|
||||
p.x = p.x + x
|
||||
p.y = p.y + y
|
||||
p.z = p.z + z
|
||||
p.shift(x, y, z)
|
||||
|
||||
self.modified()
|
||||
|
||||
def modified(self):
|
||||
self.tab_up_to_date = False
|
||||
self.station_up_to_date = False
|
||||
|
||||
def add_npoints(self, npoints):
|
||||
# add npoints in a profile
|
||||
for k in range(npoints):
|
||||
|
||||
@@ -26,6 +26,8 @@ from functools import reduce
|
||||
from SQL import SQL
|
||||
from Model.Except import NotImplementedMethodeError
|
||||
|
||||
from tools import trace
|
||||
|
||||
from Model.Tools.PamhyrID import PamhyrID
|
||||
|
||||
logger = logging.getLogger()
|
||||
|
||||
Reference in new issue
Block a user