Mejorado logica de Zindex para los Panel Plate y los ExtraccionTag. Las osGuia ahora al modificar la posicion se actualiza la simulacion en tiempo real.

This commit is contained in:
Miguel 2024-07-03 16:12:54 +02:00
parent c8abb98c7d
commit 261fe679d8
5 changed files with 97 additions and 83 deletions

View File

@ -12,6 +12,7 @@ namespace CtrEditor.FuncionesBase
Estaticos = 2, Estaticos = 2,
Generadores = 3, Generadores = 3,
Guias = 4, Guias = 4,
ExtraccionTag = 5,
Dinamicos = 10, Dinamicos = 10,
Descarte = 11, Descarte = 11,
Fotocelula = 12, Fotocelula = 12,

View File

@ -247,6 +247,9 @@ namespace CtrEditor
double rectSize = 10; double rectSize = 10;
RemoveResizeRectangles(); RemoveResizeRectangles();
if (userControl is IDataContainer dataContainer && dataContainer.Datos is osBase mvBase && mvBase.Show_On_This_Page)
{
// Obtener el BoundingBox aproximado del UserControl // Obtener el BoundingBox aproximado del UserControl
Rect boundingBox = VisualTreeHelper.GetDescendantBounds(userControl); Rect boundingBox = VisualTreeHelper.GetDescendantBounds(userControl);
@ -344,6 +347,7 @@ namespace CtrEditor
ResetTimerRemoveResizeRectangles(); ResetTimerRemoveResizeRectangles();
} }
} }
}
@ -536,7 +540,7 @@ namespace CtrEditor
var newY = Canvas.GetTop(_currentDraggingControl) + dy; var newY = Canvas.GetTop(_currentDraggingControl) + dy;
mvBase.Move(newX, newY); mvBase.Move(newX, newY);
// dataContainer.Move((float)newX, (float)newY); // dataContainer.Move((float)newX, (float)newY);
} }
if (ActivateRotation) if (ActivateRotation)
{ {

View File

@ -35,6 +35,11 @@ namespace CtrEditor.ObjetosSim
UpdateOrCreateLine(SimGeometria, uc.Guia); UpdateOrCreateLine(SimGeometria, uc.Guia);
} }
public override void OnMoveResizeRotate()
{
ActualizarGeometrias();
}
public osGuia() public osGuia()
{ {
Ancho = 1; Ancho = 1;

View File

@ -224,7 +224,7 @@ namespace CtrEditor.ObjetosSim.Extraccion_Datos
public void Highlight(bool State) { } public void Highlight(bool State) { }
public ZIndexEnum ZIndex() public ZIndexEnum ZIndex()
{ {
return ZIndexEnum.Estaticos; return ZIndexEnum.ExtraccionTag;
} }

View File

@ -78,7 +78,6 @@ namespace CtrEditor.ObjetosSim
[property: Category("Layout:")] [property: Category("Layout:")]
private float left; private float left;
public void CheckData() public void CheckData()
{ {
if (Id is null) if (Id is null)
@ -164,6 +163,7 @@ namespace CtrEditor.ObjetosSim
var Delta_H = PixelToMeter.Instance.calc.PixelsToMeters(Delta_H_pixels); var Delta_H = PixelToMeter.Instance.calc.PixelsToMeters(Delta_H_pixels);
OnResize(Delta_W, Delta_H); OnResize(Delta_W, Delta_H);
OnMoveResizeRotate();
if ((Angulo >= 45 && Angulo <= 135) || (Angulo >= 225 && Angulo <= 315)) if ((Angulo >= 45 && Angulo <= 135) || (Angulo >= 225 && Angulo <= 315))
{ {
@ -186,9 +186,10 @@ namespace CtrEditor.ObjetosSim
} }
public void Move(float LeftPixels, float TopPixels) public void Move(float LeftPixels, float TopPixels)
{ {
OnMove(LeftPixels, TopPixels);
Left = PixelToMeter.Instance.calc.PixelsToMeters(LeftPixels); Left = PixelToMeter.Instance.calc.PixelsToMeters(LeftPixels);
Top = PixelToMeter.Instance.calc.PixelsToMeters(TopPixels); Top = PixelToMeter.Instance.calc.PixelsToMeters(TopPixels);
OnMove(LeftPixels, TopPixels);
OnMoveResizeRotate();
} }
public virtual void OnMove(float LeftPixels, float TopPixels) { } public virtual void OnMove(float LeftPixels, float TopPixels) { }
@ -205,9 +206,12 @@ namespace CtrEditor.ObjetosSim
Angulo -= 360; Angulo -= 360;
OnRotate(Delta_Angle); OnRotate(Delta_Angle);
OnMoveResizeRotate();
} }
public virtual void OnRotate(float Delta_Angle) { } public virtual void OnRotate(float Delta_Angle) { }
public virtual void OnMoveResizeRotate() { }
public void InicializaNuevoObjeto() public void InicializaNuevoObjeto()
{ {
Id = new UniqueId().ObtenerNuevaID(); Id = new UniqueId().ObtenerNuevaID();