예제 #1
0
 private void Window_Closed(object sender, EventArgs e)
 {
     try
     {
         if (_velocityLines != null)
         {
             _velocityLines.Dispose();
             _velocityLines = null;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString(), this.Title, MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
예제 #2
0
        public VelocityVisualizer3DWindow()
        {
            InitializeComponent();

            // Camera Trackball
            _trackball                       = new TrackBallRoam(_camera);
            _trackball.EventSource           = grdViewPort;     //NOTE:  If this control doesn't have a background color set, the trackball won't see events (I think transparent is ok, just not null)
            _trackball.AllowZoomOnMouseWheel = true;
            _trackball.MouseWheelScale      *= .1d;
            _trackball.Mappings.AddRange(TrackBallMapping.GetPrebuilt(TrackBallMapping.PrebuiltMapping.MouseComplete));
            //_trackball.GetOrbitRadius += new GetOrbitRadiusHandler(Trackball_GetOrbitRadius);

            // Velocity line visual
            _velocityLines                   = new BillboardLine3DSet();
            _velocityLines.Color             = Colors.GhostWhite;
            _velocityLines.IsReflectiveColor = true;
            _viewport.Children.Add(_velocityLines);

            UpdateLinePlacement();

            ShowHideBlockedCells();
        }