Skip to content

Instantly share code, notes, and snippets.

@SpacePurr
Created February 19, 2020 08:05
Show Gist options
  • Save SpacePurr/14ea358a681d79fd27fca937e205d861 to your computer and use it in GitHub Desktop.
Save SpacePurr/14ea358a681d79fd27fca937e205d861 to your computer and use it in GitHub Desktop.
TestMethods Style
//public int TimeSlider { get; set; }
//public int TimeSliderCurrent { get; set; }
//public List<ModelVisual3D> History { get; set; }
//private void TestExecute(object obj)
//{
// TimeSliderCurrent = 0;
// History = new List<ModelVisual3D>();
// var modelVisual = _styler.CommonShapes.Children.FirstOrDefault() as ModelVisual3D;
// var modelGroups = modelVisual.Content as Model3DGroup;
// var commonShapes = CopyOpaquesShapes(_styler.CommonShapes);
// History.Add(commonShapes);
// TimeSlider = modelGroups.Children.Count;
//}
//public void RangeBase_OnValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
//{
// if (e.NewValue > e.OldValue)
// {
// var currentCommonShapes = CopyOpaquesShapes(History.LastOrDefault());
// var timeLineStyle = new TimeLineSurfaceStyle(currentCommonShapes);
// DrawingControl.DefaultLayerStyler = timeLineStyle;
// DrawingControl.ReloadModel(DrawingControl3D.ModelRefreshOptions.ViewPreserveCameraPosition);
// var newCommonShapes = CopyOpaquesShapes(timeLineStyle.CommonShapes);
// if (TimeSliderCurrent != TimeSlider)
// History.Add(newCommonShapes);
// }
// else
// {
// var timeLineStyle = new TimeLineSurfaceStyle(History.LastOrDefault(), true);
// DrawingControl.DefaultLayerStyler = timeLineStyle;
// DrawingControl.ReloadModel(DrawingControl3D.ModelRefreshOptions.ViewPreserveCameraPosition);
// if (TimeSliderCurrent != 0)
// History.Remove(History.LastOrDefault());
// }
//}
//private ModelVisual3D CopyOpaquesShapes(ModelVisual3D commonShapes)
//{
// var newCommonShapes = new ModelVisual3D();
// var newModelGroup = new Model3DGroup();
// foreach (var child in (((ModelVisual3D)commonShapes.Children.FirstOrDefault()).Content as Model3DGroup).Children)
// {
// newModelGroup.Children.Add(child);
// }
// var newModelVisual = new ModelVisual3D { Content = newModelGroup };
// newCommonShapes.Children.Add(newModelVisual);
// return newCommonShapes;
//}
//private void Test1Execute(object obj)
// {
// TestTask();
//}
//private TimeLineSurfaceStyle timeLineStyle;
//private void Test2Execute(object obj)
//{
// List<StylePointer> pointers = _styler.Pointers;
// var commonShapes = CopyOpaquesShapes(_styler.CommonShapes);
// if (timeLineStyle == null)
// timeLineStyle = new TimeLineSurfaceStyle(commonShapes, pointers);
// timeLineStyle.SelectedEntities = SelectedEntities;
// DrawingControl.DefaultLayerStyler = timeLineStyle;
// DrawingControl.ReloadModel(DrawingControl3D.ModelRefreshOptions.ViewPreserveCameraPosition);
//}
//public async void TestTask()
//{
// int t1 = 0;
// for (int i = 0; i < TimeSlider; i++)
// {
// t1++;
// var currentCommonShapes = CopyOpaquesShapes(History.LastOrDefault());
// var timeLineStyle = new TimeLineSurfaceStyle(currentCommonShapes);
// DrawingControl.DefaultLayerStyler = timeLineStyle;
// DrawingControl.ReloadModel(DrawingControl3D.ModelRefreshOptions.ViewPreserveCameraPosition);
// var newCommonShapes = CopyOpaquesShapes(timeLineStyle.CommonShapes);
// if (t1 != TimeSlider)
// History.Add(newCommonShapes);
// await Task.Delay(5);
// }
// for (int i = 0; i < TimeSlider; i++)
// {
// t1--;
// var timeLineStyle = new TimeLineSurfaceStyle(History.LastOrDefault(), true);
// DrawingControl.DefaultLayerStyler = timeLineStyle;
// DrawingControl.ReloadModel(DrawingControl3D.ModelRefreshOptions.ViewPreserveCameraPosition);
// if (t1 != 0)
// History.Remove(History.LastOrDefault());
// await Task.Delay(5);
// }
//}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment