示例#1
0
        private void UpdateDisplays()
        {
            Hull displayHull = myHull.CopyToFullHull();

            displayHull.Rotate(0, 0, 180);
            FrontDisplay.SetHull(displayHull);
            Debug.WriteLine("Front size: ({0})", displayHull.GetSize());

            displayHull = myHull.CopyToFullHull();
            displayHull.Rotate(0, 90, 90);
            TopDisplay.SetHull(displayHull);

            displayHull = myHull.CopyToFullHull();
            displayHull.Rotate(0, 90, 180);
            SideDisplay.SetHull(displayHull);

            if (PerspectiveManip.perspective == HullManip.PerspectiveType.FRONT)
            {
                displayHull = myHull.CopyToFullHull();
                displayHull.Rotate(0, 0, 180);
                Debug.WriteLine("Perspective Front size: ({0})", displayHull.GetSize());
                PerspectiveDisplay.SetHull(displayHull);
                Debug.WriteLine("Perspective Front size: ({0})", displayHull.GetSize());
                PerspectiveManip.perspective = HullManip.PerspectiveType.FRONT;
                PerspectiveManip.IsEditable  = true;
            }
            else if (PerspectiveManip.perspective == HullManip.PerspectiveType.TOP)
            {
                displayHull = myHull.CopyToFullHull();
                displayHull.Rotate(0, 90, 90);
                PerspectiveDisplay.SetHull(displayHull);
                PerspectiveManip.perspective = HullManip.PerspectiveType.TOP;
                PerspectiveManip.IsEditable  = true;
            }
            else if (PerspectiveManip.perspective == HullManip.PerspectiveType.SIDE)
            {
                displayHull = myHull.CopyToFullHull();
                displayHull.Rotate(0, 90, 180);
                PerspectiveDisplay.SetHull(displayHull);
                PerspectiveManip.perspective = HullManip.PerspectiveType.SIDE;
                PerspectiveManip.IsEditable  = true;
            }
            else // must be PERSPECTIVE
            {
                displayHull = myHull.CopyToFullHull();
                displayHull.Rotate(10, 30, 190);
                PerspectiveDisplay.SetHull(displayHull);
            }
            FrontManip.Draw();
            TopManip.Draw();
            SideManip.Draw();
            PerspectiveManip.Draw();
        }
示例#2
0
 public void SetHull(Hull hull)
 {
     Debug.WriteLine("HullDisplay.SetHull: ({0})", hull.GetSize());
     m_Hull  = hull;
     m_scale = 1;
     Draw();
 }
示例#3
0
        private void ResizeClick(object sender, RoutedEventArgs e)
        {
            Size3D originalSize = myHull.GetSize();

            originalSize.X *= 2;    // compensate because this is a half-hull

            ResizeWindow resize = new ResizeWindow(myHull);

            resize.ShowDialog();

            if (resize.OK)
            {
                ResizeWindowData resizeData = (ResizeWindowData)resize.FindResource("ResizeData");
                double           scale_x    = 1.0;
                double           scale_y    = 1.0;
                double           scale_z    = 1.0;

                if (resizeData != null)
                {
                    scale_x = resizeData.Width / originalSize.X;
                    scale_y = resizeData.Height / originalSize.Y;
                    scale_z = resizeData.Length / originalSize.Z;

                    myHull.Scale(scale_x, scale_y, scale_z);
                    UpdateDisplays();
                }
            }
        }
示例#4
0
        public ResizeWindow(Hull hull)
        {
            InitializeComponent();
            ResizeWindowData resizeData = (ResizeWindowData)this.FindResource("ResizeData");

            if (resizeData != null)
            {
                bool proportional = resizeData.Proportional;

                // Need to turn off Proportional for initial setup
                resizeData.Proportional = false;

                Size3D size = hull.GetSize();
                resizeData.Width        = size.X * 2; // multiply by 2 because this is half-hull
                resizeData.Height       = size.Y;
                resizeData.Length       = size.Z;
                resizeData.Proportional = true;

                // Reset proportional
                resizeData.Proportional = proportional;
            }
        }
示例#5
0
        protected Size size2d()
        {
            Size3D hullSize = m_Hull.GetSize();

            return(new Size(hullSize.X, hullSize.Y));
        }