コード例 #1
0
        //----------------------------------------------
        public bool AddFilsWithIndex(C2iComposant3D composant, int nIndex)
        {
            CGraduateCoordinate coord = new CGraduateCoordinate(composant);

            coord.Position             = nIndex;
            composant.LocationInParent = coord;
            AddFils(composant);
            return(true);
        }
コード例 #2
0
        protected override void MyRepositionneChilds()
        {
            int nCoordMin             = 0;
            List <C2iComposant3D> lst = new List <C2iComposant3D>(Childs);
            EOrientationAxe       axe = GetAxeAlignement();

            lst.Sort(delegate(C2iComposant3D c1, C2iComposant3D c2)
            {
                CPositionneurDansParentAutoFill p1 = new CPositionneurDansParentAutoFill(c1, axe);
                CPositionneurDansParentAutoFill p2 = new CPositionneurDansParentAutoFill(c2, axe);
                switch (GraduationOrientation)
                {
                case EGraduationOrientation.HorizMinToMax:
                case EGraduationOrientation.VertMinToMax:
                    return(p1.ValeurAxe.CompareTo(p2.ValeurAxe));

                case EGraduationOrientation.VertMaxToMin:
                case EGraduationOrientation.HorizMaxToMin:
                    return(p2.ValeurAxe.CompareTo(p1.ValeurAxe));
                }
                return(0);
            }
                     );

            int nTaille = new CPositionneurDansParentAutoFill(this, axe).TailleOccupee;

            foreach (C2iComposant3D fils in lst)
            {
                CPositionneurDansParentAutoFill p = new CPositionneurDansParentAutoFill(fils, axe);
                int nPos = 0;
                switch (GraduationOrientation)
                {
                case EGraduationOrientation.HorizMinToMax:
                case EGraduationOrientation.VertMinToMax:
                    nPos = (int)(p.ValeurAxe / m_nEspaceGraduations);
                    break;

                case EGraduationOrientation.HorizMaxToMin:
                case EGraduationOrientation.VertMaxToMin:
                    nPos = (int)((nTaille - p.ValeurAxe) / m_nEspaceGraduations);
                    break;
                }

                if (nPos < nCoordMin)
                {
                    nPos = nCoordMin;
                }
                AjustePosition(fils, nPos);
                CGraduateCoordinate coord = new CGraduateCoordinate(fils);
                coord.Position        = nPos;
                fils.LocationInParent = coord;
                nCoordMin             = 0;// nPos + Math.Max(1, ((int)(p.TailleOccupee / m_nEspaceGraduations)) + 1);
            }
        }
コード例 #3
0
        public override CEmplacementDansParent GetNewEmplacementForChild(C2iComposant3D composantFils)
        {
            CGraduateCoordinate coord = new CGraduateCoordinate(composantFils);

            return(coord);
        }
コード例 #4
0
        protected override void MyRepositionneChilds()
        {
            List <C2iComposant3D> lst     = GetChildsTries();
            int             nPos          = 0;
            int             nIndex        = 0;
            EOrientationAxe axe           = GetAxeAlignement();
            int             nTailleTotale = new CPositionneurDansParentAutoFill(this, axe).TailleOccupee;

            foreach (C2iComposant3D fils in lst)
            {
                int nX = fils.Position.X;
                int nY = fils.Position.Y;
                int nZ = fils.Position.Z;

                switch (HorizontalAlignment)
                {
                case E3DAlignement.Min:
                    nX = 0;
                    break;

                case E3DAlignement.Max:
                    nX = Size.With - fils.Size.With;
                    break;

                case E3DAlignement.Center:
                    nX = (Size.With - fils.Size.With) / 2;
                    break;
                }
                switch (VerticalAlignment)
                {
                case E3DAlignement.Min:
                    nY = 0;
                    break;

                case E3DAlignement.Max:
                    nY = Size.Height - fils.Size.Height;
                    break;

                case E3DAlignement.Center:
                    nY = (Size.Height - fils.Size.Height) / 2;
                    break;
                }
                switch (DepthAlignment)
                {
                case E3DAlignement.Min:
                    nZ = 0;
                    break;

                case E3DAlignement.Max:
                    nZ = Size.Depth - fils.Size.Depth;
                    break;

                case E3DAlignement.Center:
                    nZ = (Size.Depth - fils.Size.Depth) / 2;
                    break;
                }
                fils.Position = new C3DPoint(nX, nY, nZ);
                CPositionneurDansParentAutoFill p = new CPositionneurDansParentAutoFill(fils, axe);
                switch (FillOrientation)
                {
                case EGraduationOrientation.HorizMinToMax:
                case EGraduationOrientation.VertMinToMax:
                    p.ValeurAxe = nPos;
                    nPos       += p.TailleOccupee;
                    break;

                case EGraduationOrientation.HorizMaxToMin:
                case EGraduationOrientation.VertMaxToMin:
                    p.ValeurAxe = nTailleTotale - nPos;
                    nPos       += p.TailleOccupee;
                    break;

                default:
                    break;
                }
                CGraduateCoordinate coord = new CGraduateCoordinate();
                coord.Position         = nIndex;
                coord.ComposantAssocie = fils;
                fils.LocationInParent  = coord;
                nIndex++;
            }
        }