Esempio n. 1
0
 public Fleche(int nbLines)
 {
     bout         = new Bout(0, 0, color, 1, strokeThick);
     this.nbLines = nbLines;
     for (int i = 0; i < nbLines; i++)
     {
         l[i] = new Line();
     }
 }
Esempio n. 2
0
        public Fleche(double Coordx, double Coordy, SolidColorBrush Color, double taille, int typeFleche, int typebout)
        {
            this.coordX     = Coordx;
            this.coordY     = Coordy;
            this.typeFleche = typeFleche;
            this.color      = Color;
            for (int i = 0; i < nbLines; i++)
            {
                l[i] = new Line();
            }
            if (typeFleche == 1)//Fléche --->
            {
                l[0].Stroke  = Color;
                l[0].X1      = CoordX;
                l[0].Y1      = CoordY;
                height[0]    = taille;
                height[1]    = 0;
                height[2]    = 0;
                width[0]     = 0;
                width[1]     = 0;
                width[2]     = 0;
                bout         = new Bout(Coordx + height[0], Coordy + width[0], Color, typebout, strokeThick);
                this.nbLines = 1;
            }
            if (typeFleche == 2)// Fléche <---
            {
                l[0].Stroke  = Color;
                l[0].X1      = CoordX;
                l[0].Y1      = CoordY;
                height[0]    = -taille;
                height[1]    = 0;
                height[2]    = 0;
                width[0]     = 0;
                width[1]     = 0;
                width[2]     = 0;
                bout         = new Bout(Coordx + height[0], Coordy + width[0], Color, typebout, strokeThick);
                this.nbLines = 1;
            }
            if (typeFleche == 3)//Courbé bout à droite
            {
                l[0].Stroke = Color;
                l[0].X1     = CoordX;
                l[0].Y1     = CoordY;
                height[0]   = 22;
                width[0]    = 0;

                l[1].Stroke = Color;
                l[1].X1     = CoordX + height[0];
                l[1].Y1     = CoordY + width[0];
                height[1]   = 0;
                width[1]    = -50;

                l[2].Stroke = Color;
                l[2].X1     = CoordX + height[0] + height[1];
                l[2].Y1     = CoordY + width[0] + width[1];
                height[2]   = 145;
                width[2]    = 0;

                l[3].Stroke = Color;
                l[3].X1     = CoordX + height[0] + height[1] + height[2];
                l[3].Y1     = CoordY + width[0] + width[1] + width[2];
                height[3]   = 0;
                width[3]    = 40;

                l[4].Stroke = Color;
                l[4].X1     = CoordX + height[0] + height[1] + height[2] + height[3];
                l[4].Y1     = CoordY + width[0] + width[1] + width[2] + width[3];
                height[4]   = 18;
                width[4]    = 0;

                bout         = new Bout(Coordx + height[0] + height[1] + height[2] + height[3] + height[4], Coordy + width[0] + width[1] + width[2] + width[3] + width[4], Color, typebout, strokeThick);
                this.nbLines = 5;
            }
            if (typeFleche == 4)//Coubé bout à gauche
            {
                l[0].Stroke = Color;
                l[0].X1     = CoordX;
                l[0].Y1     = CoordY;
                height[0]   = -22;
                width[0]    = 0;

                l[1].Stroke = Color;
                l[1].X1     = CoordX + height[0];
                l[1].Y1     = CoordY + width[0];
                height[1]   = 0;
                width[1]    = 50;

                l[2].Stroke = Color;
                l[2].X1     = CoordX + height[0] + height[1];
                l[2].Y1     = CoordY + width[0] + width[1];
                height[2]   = -145;
                width[2]    = 0;

                l[3].Stroke = Color;
                l[3].X1     = CoordX + height[0] + height[1] + height[2];
                l[3].Y1     = CoordY + width[0] + width[1] + width[2];
                height[3]   = 0;
                width[3]    = -40;

                l[4].Stroke = Color;
                l[4].X1     = CoordX + height[0] + height[1] + height[2] + height[3];
                l[4].Y1     = CoordY + width[0] + width[1] + width[2] + width[3];
                height[4]   = -18;
                width[4]    = 0;

                bout         = new Bout(Coordx + height[0] + height[1] + height[2] + height[3] + height[4], Coordy + width[0] + width[1] + width[2] + width[3] + width[4], Color, typebout, strokeThick);
                this.nbLines = 5;
            }
            if (typeFleche == 5)
            {
                l[0].Stroke = Color;
                l[0].X1     = CoordX;
                l[0].Y1     = CoordY;
                height[0]   = 0;
                width[0]    = 60;

                l[1].Stroke = Color;
                l[1].X1     = CoordX + height[0];
                l[1].Y1     = CoordY + width[0];
                height[1]   = -taille;
                width[1]    = 0;

                l[2].Stroke = Color;
                l[2].X1     = CoordX + height[0] + height[1];
                l[2].Y1     = CoordY + width[0] + width[1];
                height[2]   = 0;
                width[2]    = -60;

                bout         = new Bout(Coordx + height[0] + height[1] + height[2], Coordy + width[0] + width[1] + width[2], Color, typebout, strokeThick);
                this.nbLines = 3;
            }
        }