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,
Generadores = 3,
Guias = 4,
ExtraccionTag = 5,
Dinamicos = 10,
Descarte = 11,
Fotocelula = 12,

View File

@ -247,6 +247,9 @@ namespace CtrEditor
double rectSize = 10;
RemoveResizeRectangles();
if (userControl is IDataContainer dataContainer && dataContainer.Datos is osBase mvBase && mvBase.Show_On_This_Page)
{
// Obtener el BoundingBox aproximado del UserControl
Rect boundingBox = VisualTreeHelper.GetDescendantBounds(userControl);
@ -344,6 +347,7 @@ namespace CtrEditor
ResetTimerRemoveResizeRectangles();
}
}
}

View File

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

View File

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

View File

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