Пример #1
0
        public C3DSize Transforme(C3DSize size)
        {
            CVecteur3D vecteur = new CVecteur3D(size.With, size.Height, size.Depth, 0.0);

            vecteur = this * vecteur;
            return(new C3DSize((int)Math.Round(vecteur[0]), (int)Math.Round(vecteur[1]), (int)Math.Round(vecteur[2])));
        }
Пример #2
0
        //--------------------------------------
        public C3DSize GlobalToClient(C3DSize size)
        {
            CTransformation3D t = CTransformation3D.Identity;

            PushTransformationGlobalToChild(t);
            return(t.Transforme(size));
        }
Пример #3
0
        //--------------------------------------
        public C3DSize ClientToGlobal(C3DSize size)
        {
            CTransformation3D t = CTransformation3D.Identity;

            PushTransformationChildToGlobal(t);
            return(t.Transforme(size));
        }
Пример #4
0
        //-----------------------------------------------------
        public EFaceVueDynamique ConvertFaceToGlobal(EFaceVueDynamique face)
        {
            C3DSize           vecteur = m_NormalesFace[(int)face];
            CTransformation3D t       = CTransformation3D.Identity;

            PushTransformationChildToGlobal(t);
            vecteur = t.Transforme(vecteur);
            foreach (EFaceVueDynamique faceTest in Enum.GetValues(typeof(EFaceVueDynamique)))
            {
                if (m_NormalesFace[(int)faceTest].Equals(vecteur))
                {
                    return(faceTest);
                }
            }
            return(face);
        }
Пример #5
0
        //-----------------------------------------------------
        private void DockChilds()
        {
            if (m_bIsDocking)
            {
                return;
            }
            m_bIsDocking = true;
            C3DPoint offset = new C3DPoint(0, 0, 0);
            C3DSize  size   = Size;

            foreach (C2iComposant3D composantFils in Childs)
            {
                CDockStyle dockStyle = composantFils.LocationInParent as CDockStyle;
                if (dockStyle != null)
                {
                    switch (dockStyle.DockStyle)
                    {
                    case E3DDockStyle.Top:
                        composantFils.Size = new C3DSize(
                            size.With,
                            composantFils.Size.Height,
                            size.Depth);
                        composantFils.Position = new C3DPoint(
                            offset.X,
                            offset.Y + size.Height - composantFils.Size.Height,
                            offset.Z);
                        size.Inflate(
                            0,
                            -composantFils.Size.Height,
                            0);
                        break;

                    case E3DDockStyle.Bottom:
                        composantFils.Size = new C3DSize(
                            size.With,
                            composantFils.Size.Height,
                            size.Depth);
                        composantFils.Position = new C3DPoint(
                            offset.X,
                            offset.Y,
                            offset.Z);
                        size.Inflate(
                            0,
                            -composantFils.Size.Height,
                            0);
                        offset.Offset(
                            0,
                            composantFils.Size.Height,
                            0);
                        break;

                    case E3DDockStyle.Left:
                        composantFils.Size = new C3DSize(
                            composantFils.Size.With,
                            size.Height,
                            size.Depth);
                        composantFils.Position = new C3DPoint(
                            offset.X,
                            offset.Y,
                            offset.Z);
                        size.Inflate(
                            -composantFils.Size.With,
                            0,
                            0);
                        offset.Offset(
                            composantFils.Size.With,
                            0,
                            0);
                        break;

                    case E3DDockStyle.Right:
                        composantFils.Size = new C3DSize(
                            composantFils.Size.With,
                            size.Height,
                            size.Depth);
                        composantFils.Position = new C3DPoint(
                            offset.X + size.With - composantFils.Size.With,
                            offset.Y,
                            offset.Z);
                        size.Inflate(
                            -composantFils.Size.With,
                            0,
                            0);
                        break;

                    case E3DDockStyle.Back:
                        composantFils.Size = new C3DSize(
                            size.With,
                            size.Height,
                            composantFils.Size.Depth);
                        composantFils.Position = new C3DPoint(
                            offset.X,
                            offset.Y,
                            offset.Z);
                        size.Inflate(0,
                                     0,
                                     -composantFils.Size.Depth);
                        offset.Offset(0, 0, composantFils.Size.Depth);
                        break;

                    case E3DDockStyle.Front:
                        composantFils.Size = new C3DSize(
                            size.With,
                            size.Height,
                            composantFils.Size.Depth);
                        composantFils.Position = new C3DPoint(
                            offset.X,
                            offset.Y,
                            offset.Z + size.Depth - composantFils.Size.Depth);
                        size.Inflate(
                            0,
                            0,
                            -composantFils.Size.Depth);
                        break;

                    case E3DDockStyle.Fill:
                        composantFils.Position = offset;
                        composantFils.Size     = size;
                        break;

                    default:
                        break;
                    }
                }
            }
            m_bIsDocking = false;
        }
Пример #6
0
 //--------------------------------------------------
 public C3DPrimitiveCube(C3DPoint position, C3DSize size, Color couleur)
 {
     m_position = position;
     m_size     = size;
     m_couleur  = couleur;
 }
Пример #7
0
 public C2iComposant3DCube()
 {
     Size = new C3DSize(7500, 7500, 7500);
 }