Example #1
0
        // déplace à une position donnée
        public void Deplace(Couple positionDestination)
        {
            positionDestination.X -= _position.X;
            positionDestination.Y -= _position.Y;

            Deplace(positionDestination.Xi, positionDestination.Yi);
        }
Example #2
0
        public Element()
        {
            _elements = new Dictionary <string, Figure>();

            _position = new Couple(0, 0);

            this.zoom = 1;
        }
Example #3
0
        public static Couple operator -(Couple couple, float nombre)
        {
            Couple coupleResultat = new Couple(
                couple.X - nombre,
                couple.Y - nombre
                );

            return(coupleResultat);
        }
Example #4
0
        public static Couple operator -(Couple couple1, Couple couple2)
        {
            Couple coupleResultat = new Couple(
                couple1.X - couple2.X,
                couple1.Y - couple2.Y
                );

            return(coupleResultat);
        }
Example #5
0
        public void AjouterLigne(string cle, Color contour, int largeurContour)
        {
            if (_elements.ContainsKey(cle))
            {
                return;
            }

            Couple positionSource      = _position;
            Couple positionDestination = _dimensions;

            _elements.Add(cle, new Ligne(Graphique, positionSource, positionDestination, contour, largeurContour));
        }
Example #6
0
        // rectifie la position par rapport au parent
        protected void AjustePosition(string enfant, string parent, Couple positionPreCalculee = default)
        {
            if (positionPreCalculee == default)
            {
                _elements[enfant].Position = _elements[parent].PointAdjacent(Figure.Y);
            }
            else
            {
                _elements[enfant].Position = positionPreCalculee;
            }

            AjoutEnfant(enfant, parent);
        }
Example #7
0
 public void Positionne(float x, float y)
 {
     _position = new Couple(x * zoom, y * zoom);
 }
Example #8
0
 public void Dimensionne(Couple taille)
 {
     _dimensions = taille.Copie();
 }
Example #9
0
 public void Dimensionne(Size taille)
 {
     _dimensions = new Couple(taille);
 }
Example #10
0
 public void Dimensionne(double x)
 {
     _dimensions = new Couple(x * zoom, x * zoom);
 }
Example #11
0
 public void Dimensionne(float x)
 {
     _dimensions = new Couple(x * zoom, x * zoom);
 }
Example #12
0
 public Element(Couple position) : this()
 {
     this._position = position.Copie();
 }
Example #13
0
 public void Positionne(Couple pos)
 {
     _position = pos.Copie();
 }
Example #14
0
 public void Positionne(double x)
 {
     _position = new Couple(x * zoom, x * zoom);
 }
Example #15
0
 public void Positionne(double x, double y)
 {
     _position = new Couple(x * zoom, y * zoom);
 }
Example #16
0
 public void Positionne(float x)
 {
     _position = new Couple(x * zoom, x * zoom);
 }