2024-05-02 11:06:45 -03:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows;
|
|
|
|
|
using System.Windows.Controls;
|
|
|
|
|
using System.Windows.Data;
|
|
|
|
|
using System.Windows.Documents;
|
|
|
|
|
using System.Windows.Input;
|
|
|
|
|
using System.Windows.Media;
|
|
|
|
|
using System.Windows.Media.Imaging;
|
|
|
|
|
using System.Windows.Navigation;
|
|
|
|
|
using System.Windows.Shapes;
|
2024-05-06 12:31:45 -03:00
|
|
|
|
using System.Numerics;
|
2024-05-02 11:06:45 -03:00
|
|
|
|
|
2024-05-04 06:00:52 -03:00
|
|
|
|
namespace CtrEditor.ObjetosSim
|
2024-05-02 11:06:45 -03:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2024-05-04 06:00:52 -03:00
|
|
|
|
/// Interaction logic for ucBotella.xaml
|
2024-05-02 11:06:45 -03:00
|
|
|
|
/// </summary>
|
2024-05-04 06:00:52 -03:00
|
|
|
|
///
|
|
|
|
|
|
|
|
|
|
public class osBotella : osBase
|
2024-05-02 11:06:45 -03:00
|
|
|
|
{
|
2024-05-06 12:31:45 -03:00
|
|
|
|
private Circle Data = new Circle();
|
|
|
|
|
|
2024-05-04 06:00:52 -03:00
|
|
|
|
// Otros datos y métodos relevantes para la simulación
|
|
|
|
|
|
2024-05-04 15:35:06 -03:00
|
|
|
|
private string _nombre = "Botella";
|
2024-05-06 12:31:45 -03:00
|
|
|
|
|
|
|
|
|
public float Diametro {
|
|
|
|
|
get => Data.Diameter;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
Data.Diameter = value;
|
|
|
|
|
OnPropertyChanged(nameof(Diametro));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public float Mass {
|
|
|
|
|
get => Data.Mass;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
Data.Mass = value;
|
|
|
|
|
OnPropertyChanged(nameof(Mass));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override float Left
|
2024-05-03 05:13:25 -03:00
|
|
|
|
{
|
2024-05-06 12:31:45 -03:00
|
|
|
|
get => Data.Center.X;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
Data.Center = new Vector2(value,Top);
|
|
|
|
|
if (_visualRepresentation != null)
|
|
|
|
|
Canvas.SetLeft(_visualRepresentation, value);
|
|
|
|
|
OnPropertyChanged(nameof(Left));
|
|
|
|
|
}
|
2024-05-03 05:13:25 -03:00
|
|
|
|
}
|
2024-05-06 12:31:45 -03:00
|
|
|
|
public override float Top
|
|
|
|
|
{
|
|
|
|
|
get => Data.Center.Y;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
Data.Center = new Vector2(Left, value);
|
|
|
|
|
if (_visualRepresentation != null)
|
|
|
|
|
Canvas.SetTop(_visualRepresentation, value);
|
|
|
|
|
OnPropertyChanged(nameof(Top));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public override void ConnectSimManager(SimulationManager simulationManager)
|
|
|
|
|
{
|
|
|
|
|
simulationManager.circles.Add(Data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void UpdateControl()
|
|
|
|
|
{
|
|
|
|
|
Top = Data.Center.Y;
|
|
|
|
|
Left = Data.Center.X;
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-02 11:06:45 -03:00
|
|
|
|
}
|
2024-05-03 03:58:21 -03:00
|
|
|
|
|
2024-05-04 15:35:06 -03:00
|
|
|
|
public partial class ucBotella : UserControl, IDataContainer
|
2024-05-04 06:00:52 -03:00
|
|
|
|
{
|
2024-05-04 15:35:06 -03:00
|
|
|
|
public osBase? Datos { get; set; }
|
|
|
|
|
|
2024-05-04 06:00:52 -03:00
|
|
|
|
public ucBotella()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
2024-05-06 12:31:45 -03:00
|
|
|
|
public void Resize(float width, float height) { }
|
|
|
|
|
public void Move(float Left, float Top)
|
2024-05-04 15:35:06 -03:00
|
|
|
|
{
|
|
|
|
|
if (Datos != null)
|
|
|
|
|
{
|
|
|
|
|
Datos.Left = Left;
|
|
|
|
|
Datos.Top = Top;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-05-06 12:31:45 -03:00
|
|
|
|
public void Rotate(float Angle) { }
|
2024-05-04 16:27:04 -03:00
|
|
|
|
public void Highlight(bool State) { }
|
2024-05-04 15:35:06 -03:00
|
|
|
|
|
2024-05-04 06:00:52 -03:00
|
|
|
|
}
|
2024-05-02 11:06:45 -03:00
|
|
|
|
}
|