mirror of https://gitlab.com/pamhyr/pamhyr2
Geometry: Update RK refactoring and fix modified flag.
parent
d1c34fb437
commit
7b88d955e5
|
|
@ -365,3 +365,9 @@ class Friction(SQLSubModel):
|
||||||
# self.end_strickler.medium])
|
# self.end_strickler.medium])
|
||||||
|
|
||||||
return minor, medium
|
return minor, medium
|
||||||
|
|
||||||
|
def update_rks(self, begin_rk, end_rk):
|
||||||
|
self._begin_rk = begin_rk
|
||||||
|
self._end_rk = end_rk
|
||||||
|
|
||||||
|
self.modified()
|
||||||
|
|
|
||||||
|
|
@ -967,3 +967,9 @@ class Reach(SQLSubModel):
|
||||||
break
|
break
|
||||||
|
|
||||||
return global_index
|
return global_index
|
||||||
|
|
||||||
|
def update_rks(self, rks):
|
||||||
|
for rk, profile in zip(rks, self.profiles):
|
||||||
|
profile.rk = rk
|
||||||
|
|
||||||
|
self.modified()
|
||||||
|
|
|
||||||
|
|
@ -247,14 +247,13 @@ class UpdateRKCommand(QUndoCommand):
|
||||||
self._new_end_rk = None
|
self._new_end_rk = None
|
||||||
|
|
||||||
def undo(self):
|
def undo(self):
|
||||||
for rk, profile in zip(self._rks, self._reach.profiles):
|
|
||||||
profile.rk = rk
|
self._reach.update_rks(self._rks)
|
||||||
|
|
||||||
for begin_rk, end_rk, friction in zip(self._begin_rk,
|
for begin_rk, end_rk, friction in zip(self._begin_rk,
|
||||||
self._end_rk,
|
self._end_rk,
|
||||||
self._frictions):
|
self._frictions):
|
||||||
friction.begin_rk = begin_rk
|
friction.update_rks(begin_rk, end_rk)
|
||||||
friction.end_rk = end_rk
|
|
||||||
|
|
||||||
def redo(self):
|
def redo(self):
|
||||||
if self._new_rks is None:
|
if self._new_rks is None:
|
||||||
|
|
@ -264,13 +263,12 @@ class UpdateRKCommand(QUndoCommand):
|
||||||
**self._data
|
**self._data
|
||||||
)
|
)
|
||||||
|
|
||||||
for rk, profile in zip(self._new_rks, self._reach.profiles):
|
self._reach.update_rks(self._new_rks)
|
||||||
profile.rk = rk
|
|
||||||
for begin_rk, end_rk, friction in zip(self._new_begin_rk,
|
for begin_rk, end_rk, friction in zip(self._new_begin_rk,
|
||||||
self._new_end_rk,
|
self._new_end_rk,
|
||||||
self._frictions):
|
self._frictions):
|
||||||
friction.begin_rk = begin_rk
|
friction.update_rks(begin_rk, end_rk)
|
||||||
friction.end_rk = end_rk
|
|
||||||
|
|
||||||
|
|
||||||
class MeshingCommand(QUndoCommand):
|
class MeshingCommand(QUndoCommand):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue