134 lines
4.1 KiB
C#
134 lines
4.1 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Drawing;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
using System.Windows.Forms;
|
|||
|
|
|||
|
namespace Bonhomme02
|
|||
|
{
|
|||
|
class Pied : Peau
|
|||
|
{
|
|||
|
/* |Jambe|
|
|||
|
* CIG | | CID
|
|||
|
* #---|-----|---------#
|
|||
|
* | | | | /\ | ------> & <------ = longuer
|
|||
|
* |<-----#----------->| \/ & /\ = epaisseur
|
|||
|
* | | | doigt est à 0 °R et Talon π °R ou 0 °R si la longueur est négative
|
|||
|
* #------#------------# doigt est la base
|
|||
|
* Talon doigt
|
|||
|
* CSG CSD
|
|||
|
*
|
|||
|
*/
|
|||
|
|
|||
|
|
|||
|
Vecteur talon;
|
|||
|
public Pied() : base()
|
|||
|
{
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
public Pied(PictureBox hebergeur) : base(hebergeur)
|
|||
|
{
|
|||
|
}
|
|||
|
|
|||
|
public Pied(PictureBox hebergeur, int xy) : base(hebergeur, xy)
|
|||
|
{
|
|||
|
}
|
|||
|
|
|||
|
public Pied(PictureBox hebergeur, int x, int y, double lg, double ep, double angle) : base(hebergeur, x, y, lg, ep, angle)
|
|||
|
{
|
|||
|
InitVecteurs(lg, ep, angle);
|
|||
|
}
|
|||
|
public Pied(PictureBox hebergeur, ref Peau parent, double lg, double ep, double angle) : base(hebergeur, parent.coordonnee.X, parent.Coordonnee.Y, lg, ep, angle)
|
|||
|
{
|
|||
|
base.parent = parent;
|
|||
|
talon = new Vecteur(lg , angle);
|
|||
|
InitVecteurs(lg, ep, angle);
|
|||
|
}
|
|||
|
public Pied(int x, int y) : base(x, y)
|
|||
|
{
|
|||
|
}
|
|||
|
public Pied(PictureBox hebergeur, int xy, Color crayon) : base(hebergeur, xy, crayon)
|
|||
|
{
|
|||
|
}
|
|||
|
|
|||
|
public Pied(PictureBox hebergeur, int x, int y, Color crayon) : base(hebergeur, x, y, crayon)
|
|||
|
{
|
|||
|
}
|
|||
|
|
|||
|
#region accesseur
|
|||
|
|
|||
|
public override Point CIG { get { return base.Coordonnee - talon + base.epaisseur; } }
|
|||
|
public override Point CID { get { return base.Coordonnee + base.longueur + base.epaisseur; } }
|
|||
|
public override Point CSG { get { return (base.Coordonnee - talon) - base.epaisseur; } }
|
|||
|
public override Point CSD { get { return (base.Coordonnee + base.longueur) - base.epaisseur; } }
|
|||
|
#endregion
|
|||
|
|
|||
|
#region methode
|
|||
|
private void InitVecteurs(double lg, double ep, double angle)
|
|||
|
{
|
|||
|
base.longueur = new Vecteur(lg, angle);
|
|||
|
base.epaisseur = new Vecteur(ep, ref base.longueur, true);
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
/* public override void Afficher(IntPtr handle)
|
|||
|
{
|
|||
|
if (base.Visible)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
Graphics gr = Graphics.FromHwnd(handle);
|
|||
|
Point[] l = new Point[4] { CIG, CID, CSD, CSG };
|
|||
|
if (base.Remplir)
|
|||
|
{
|
|||
|
gr.FillClosedCurve(new SolidBrush(Color.Blue), l);
|
|||
|
}
|
|||
|
gr.DrawClosedCurve(new Pen(Brushes.Black), l);
|
|||
|
}
|
|||
|
catch
|
|||
|
{
|
|||
|
|
|||
|
}
|
|||
|
}
|
|||
|
}*/
|
|||
|
/*public override public void Afficher(IntPtr handle, float angle)
|
|||
|
{
|
|||
|
this.angleRotation = angle;
|
|||
|
if (visible)
|
|||
|
{
|
|||
|
Graphics gr = Graphics.FromHwnd(handle);
|
|||
|
Point[] l = new Point[4] { CSG, CSD, CID, CIG };
|
|||
|
if (remplir)
|
|||
|
{
|
|||
|
gr.FillClosedCurve(new SolidBrush(fond), l);
|
|||
|
}
|
|||
|
gr.DrawClosedCurve(new Pen(contour, eppaisseurContour), l);
|
|||
|
}
|
|||
|
}*/
|
|||
|
/* public override void Cacher(IntPtr handle)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
if (base.Visible && 1 == 1)
|
|||
|
{
|
|||
|
Graphics gr = Graphics.FromHwnd(handle);
|
|||
|
Point[] l = new Point[4] { CIG, CID, CSD, CSG };
|
|||
|
if (base.Remplir)
|
|||
|
{
|
|||
|
gr.FillClosedCurve(new SolidBrush(base.Fond), l);
|
|||
|
}
|
|||
|
gr.DrawClosedCurve(new Pen(Brushes.Black), l);
|
|||
|
}
|
|||
|
}
|
|||
|
catch
|
|||
|
{
|
|||
|
|
|||
|
}
|
|||
|
}*/
|
|||
|
#endregion
|
|||
|
}
|
|||
|
}
|