コード例 #1
1
ファイル: KnownTypes.cs プロジェクト: sjyanxin/WPFSource
        // Code compiled into PresentationFramework.dll

        // Initialize known object types
        internal static object CreateKnownElement(KnownElements knownElement) 
        {
            object o = null; 
            switch (knownElement) 
            {
                case KnownElements.AccessText: o = new System.Windows.Controls.AccessText();   break; 
                case KnownElements.AdornedElementPlaceholder: o = new System.Windows.Controls.AdornedElementPlaceholder();   break;
                case KnownElements.AdornerDecorator: o = new System.Windows.Documents.AdornerDecorator();   break;
                case KnownElements.AmbientLight: o = new System.Windows.Media.Media3D.AmbientLight();   break;
                case KnownElements.Application: o = new System.Windows.Application();   break; 
                case KnownElements.ArcSegment: o = new System.Windows.Media.ArcSegment();   break;
                case KnownElements.ArrayExtension: o = new System.Windows.Markup.ArrayExtension();   break; 
                case KnownElements.AxisAngleRotation3D: o = new System.Windows.Media.Media3D.AxisAngleRotation3D();   break; 
                case KnownElements.BeginStoryboard: o = new System.Windows.Media.Animation.BeginStoryboard();   break;
                case KnownElements.BevelBitmapEffect: o = new System.Windows.Media.Effects.BevelBitmapEffect();   break; 
                case KnownElements.BezierSegment: o = new System.Windows.Media.BezierSegment();   break;
                case KnownElements.Binding: o = new System.Windows.Data.Binding();   break;
                case KnownElements.BitmapEffectCollection: o = new System.Windows.Media.Effects.BitmapEffectCollection();   break;
                case KnownElements.BitmapEffectGroup: o = new System.Windows.Media.Effects.BitmapEffectGroup();   break; 
                case KnownElements.BitmapEffectInput: o = new System.Windows.Media.Effects.BitmapEffectInput();   break;
                case KnownElements.BitmapImage: o = new System.Windows.Media.Imaging.BitmapImage();   break; 
                case KnownElements.BlockUIContainer: o = new System.Windows.Documents.BlockUIContainer();   break; 
                case KnownElements.BlurBitmapEffect: o = new System.Windows.Media.Effects.BlurBitmapEffect();   break;
                case KnownElements.BmpBitmapEncoder: o = new System.Windows.Media.Imaging.BmpBitmapEncoder();   break; 
                case KnownElements.Bold: o = new System.Windows.Documents.Bold();   break;
                case KnownElements.BoolIListConverter: o = new System.Windows.Media.Converters.BoolIListConverter();   break;
                case KnownElements.BooleanAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.BooleanAnimationUsingKeyFrames();   break;
                case KnownElements.BooleanConverter: o = new System.ComponentModel.BooleanConverter();   break; 
                case KnownElements.BooleanKeyFrameCollection: o = new System.Windows.Media.Animation.BooleanKeyFrameCollection();   break;
                case KnownElements.BooleanToVisibilityConverter: o = new System.Windows.Controls.BooleanToVisibilityConverter();   break; 
                case KnownElements.Border: o = new System.Windows.Controls.Border();   break; 
                case KnownElements.BorderGapMaskConverter: o = new System.Windows.Controls.BorderGapMaskConverter();   break;
                case KnownElements.BrushConverter: o = new System.Windows.Media.BrushConverter();   break; 
                case KnownElements.BulletDecorator: o = new System.Windows.Controls.Primitives.BulletDecorator();   break;
                case KnownElements.Button: o = new System.Windows.Controls.Button();   break;
                case KnownElements.ByteAnimation: o = new System.Windows.Media.Animation.ByteAnimation();   break;
                case KnownElements.ByteAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.ByteAnimationUsingKeyFrames();   break; 
                case KnownElements.ByteConverter: o = new System.ComponentModel.ByteConverter();   break;
                case KnownElements.ByteKeyFrameCollection: o = new System.Windows.Media.Animation.ByteKeyFrameCollection();   break; 
                case KnownElements.Canvas: o = new System.Windows.Controls.Canvas();   break; 
                case KnownElements.CharAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.CharAnimationUsingKeyFrames();   break;
                case KnownElements.CharConverter: o = new System.ComponentModel.CharConverter();   break; 
                case KnownElements.CharIListConverter: o = new System.Windows.Media.Converters.CharIListConverter();   break;
                case KnownElements.CharKeyFrameCollection: o = new System.Windows.Media.Animation.CharKeyFrameCollection();   break;
                case KnownElements.CheckBox: o = new System.Windows.Controls.CheckBox();   break;
                case KnownElements.CollectionContainer: o = new System.Windows.Data.CollectionContainer();   break; 
                case KnownElements.CollectionViewSource: o = new System.Windows.Data.CollectionViewSource();   break;
                case KnownElements.Color: o = new System.Windows.Media.Color();   break; 
                case KnownElements.ColorAnimation: o = new System.Windows.Media.Animation.ColorAnimation();   break; 
                case KnownElements.ColorAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.ColorAnimationUsingKeyFrames();   break;
                case KnownElements.ColorConvertedBitmap: o = new System.Windows.Media.Imaging.ColorConvertedBitmap();   break; 
                case KnownElements.ColorConvertedBitmapExtension: o = new System.Windows.ColorConvertedBitmapExtension();   break;
                case KnownElements.ColorConverter: o = new System.Windows.Media.ColorConverter();   break;
                case KnownElements.ColorKeyFrameCollection: o = new System.Windows.Media.Animation.ColorKeyFrameCollection();   break;
                case KnownElements.ColumnDefinition: o = new System.Windows.Controls.ColumnDefinition();   break; 
                case KnownElements.CombinedGeometry: o = new System.Windows.Media.CombinedGeometry();   break;
                case KnownElements.ComboBox: o = new System.Windows.Controls.ComboBox();   break; 
                case KnownElements.ComboBoxItem: o = new System.Windows.Controls.ComboBoxItem();   break; 
                case KnownElements.CommandConverter: o = new System.Windows.Input.CommandConverter();   break;
                case KnownElements.ComponentResourceKey: o = new System.Windows.ComponentResourceKey();   break; 
                case KnownElements.ComponentResourceKeyConverter: o = new System.Windows.Markup.ComponentResourceKeyConverter();   break;
                case KnownElements.Condition: o = new System.Windows.Condition();   break;
                case KnownElements.ContainerVisual: o = new System.Windows.Media.ContainerVisual();   break;
                case KnownElements.ContentControl: o = new System.Windows.Controls.ContentControl();   break; 
                case KnownElements.ContentElement: o = new System.Windows.ContentElement();   break;
                case KnownElements.ContentPresenter: o = new System.Windows.Controls.ContentPresenter();   break; 
                case KnownElements.ContextMenu: o = new System.Windows.Controls.ContextMenu();   break; 
                case KnownElements.Control: o = new System.Windows.Controls.Control();   break;
                case KnownElements.ControlTemplate: o = new System.Windows.Controls.ControlTemplate();   break; 
                case KnownElements.CornerRadius: o = new System.Windows.CornerRadius();   break;
                case KnownElements.CornerRadiusConverter: o = new System.Windows.CornerRadiusConverter();   break;
                case KnownElements.CroppedBitmap: o = new System.Windows.Media.Imaging.CroppedBitmap();   break;
                case KnownElements.CultureInfoConverter: o = new System.ComponentModel.CultureInfoConverter();   break; 
                case KnownElements.CultureInfoIetfLanguageTagConverter: o = new System.Windows.CultureInfoIetfLanguageTagConverter();   break;
                case KnownElements.CursorConverter: o = new System.Windows.Input.CursorConverter();   break; 
                case KnownElements.DashStyle: o = new System.Windows.Media.DashStyle();   break; 
                case KnownElements.DataTemplate: o = new System.Windows.DataTemplate();   break;
                case KnownElements.DataTemplateKey: o = new System.Windows.DataTemplateKey();   break; 
                case KnownElements.DataTrigger: o = new System.Windows.DataTrigger();   break;
                case KnownElements.DateTimeConverter: o = new System.ComponentModel.DateTimeConverter();   break;
                case KnownElements.DateTimeConverter2: o = new System.Windows.Markup.DateTimeConverter2();   break;
                case KnownElements.DecimalAnimation: o = new System.Windows.Media.Animation.DecimalAnimation();   break; 
                case KnownElements.DecimalAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.DecimalAnimationUsingKeyFrames();   break;
                case KnownElements.DecimalConverter: o = new System.ComponentModel.DecimalConverter();   break; 
                case KnownElements.DecimalKeyFrameCollection: o = new System.Windows.Media.Animation.DecimalKeyFrameCollection();   break; 
                case KnownElements.Decorator: o = new System.Windows.Controls.Decorator();   break;
                case KnownElements.DependencyObject: o = new System.Windows.DependencyObject();   break; 
                case KnownElements.DependencyPropertyConverter: o = new System.Windows.Markup.DependencyPropertyConverter();   break;
                case KnownElements.DialogResultConverter: o = new System.Windows.DialogResultConverter();   break;
                case KnownElements.DiffuseMaterial: o = new System.Windows.Media.Media3D.DiffuseMaterial();   break;
                case KnownElements.DirectionalLight: o = new System.Windows.Media.Media3D.DirectionalLight();   break; 
                case KnownElements.DiscreteBooleanKeyFrame: o = new System.Windows.Media.Animation.DiscreteBooleanKeyFrame();   break;
                case KnownElements.DiscreteByteKeyFrame: o = new System.Windows.Media.Animation.DiscreteByteKeyFrame();   break; 
                case KnownElements.DiscreteCharKeyFrame: o = new System.Windows.Media.Animation.DiscreteCharKeyFrame();   break; 
                case KnownElements.DiscreteColorKeyFrame: o = new System.Windows.Media.Animation.DiscreteColorKeyFrame();   break;
                case KnownElements.DiscreteDecimalKeyFrame: o = new System.Windows.Media.Animation.DiscreteDecimalKeyFrame();   break; 
                case KnownElements.DiscreteDoubleKeyFrame: o = new System.Windows.Media.Animation.DiscreteDoubleKeyFrame();   break;
                case KnownElements.DiscreteInt16KeyFrame: o = new System.Windows.Media.Animation.DiscreteInt16KeyFrame();   break;
                case KnownElements.DiscreteInt32KeyFrame: o = new System.Windows.Media.Animation.DiscreteInt32KeyFrame();   break;
                case KnownElements.DiscreteInt64KeyFrame: o = new System.Windows.Media.Animation.DiscreteInt64KeyFrame();   break; 
                case KnownElements.DiscreteMatrixKeyFrame: o = new System.Windows.Media.Animation.DiscreteMatrixKeyFrame();   break;
                case KnownElements.DiscreteObjectKeyFrame: o = new System.Windows.Media.Animation.DiscreteObjectKeyFrame();   break; 
                case KnownElements.DiscretePoint3DKeyFrame: o = new System.Windows.Media.Animation.DiscretePoint3DKeyFrame();   break; 
                case KnownElements.DiscretePointKeyFrame: o = new System.Windows.Media.Animation.DiscretePointKeyFrame();   break;
                case KnownElements.DiscreteQuaternionKeyFrame: o = new System.Windows.Media.Animation.DiscreteQuaternionKeyFrame();   break; 
                case KnownElements.DiscreteRectKeyFrame: o = new System.Windows.Media.Animation.DiscreteRectKeyFrame();   break;
                case KnownElements.DiscreteRotation3DKeyFrame: o = new System.Windows.Media.Animation.DiscreteRotation3DKeyFrame();   break;
                case KnownElements.DiscreteSingleKeyFrame: o = new System.Windows.Media.Animation.DiscreteSingleKeyFrame();   break;
                case KnownElements.DiscreteSizeKeyFrame: o = new System.Windows.Media.Animation.DiscreteSizeKeyFrame();   break; 
                case KnownElements.DiscreteStringKeyFrame: o = new System.Windows.Media.Animation.DiscreteStringKeyFrame();   break;
                case KnownElements.DiscreteThicknessKeyFrame: o = new System.Windows.Media.Animation.DiscreteThicknessKeyFrame();   break; 
                case KnownElements.DiscreteVector3DKeyFrame: o = new System.Windows.Media.Animation.DiscreteVector3DKeyFrame();   break; 
                case KnownElements.DiscreteVectorKeyFrame: o = new System.Windows.Media.Animation.DiscreteVectorKeyFrame();   break;
                case KnownElements.DockPanel: o = new System.Windows.Controls.DockPanel();   break; 
                case KnownElements.DocumentPageView: o = new System.Windows.Controls.Primitives.DocumentPageView();   break;
                case KnownElements.DocumentReference: o = new System.Windows.Documents.DocumentReference();   break;
                case KnownElements.DocumentViewer: o = new System.Windows.Controls.DocumentViewer();   break;
                case KnownElements.DoubleAnimation: o = new System.Windows.Media.Animation.DoubleAnimation();   break; 
                case KnownElements.DoubleAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.DoubleAnimationUsingKeyFrames();   break;
                case KnownElements.DoubleAnimationUsingPath: o = new System.Windows.Media.Animation.DoubleAnimationUsingPath();   break; 
                case KnownElements.DoubleCollection: o = new System.Windows.Media.DoubleCollection();   break; 
                case KnownElements.DoubleCollectionConverter: o = new System.Windows.Media.DoubleCollectionConverter();   break;
                case KnownElements.DoubleConverter: o = new System.ComponentModel.DoubleConverter();   break; 
                case KnownElements.DoubleIListConverter: o = new System.Windows.Media.Converters.DoubleIListConverter();   break;
                case KnownElements.DoubleKeyFrameCollection: o = new System.Windows.Media.Animation.DoubleKeyFrameCollection();   break;
                case KnownElements.DrawingBrush: o = new System.Windows.Media.DrawingBrush();   break;
                case KnownElements.DrawingCollection: o = new System.Windows.Media.DrawingCollection();   break; 
                case KnownElements.DrawingGroup: o = new System.Windows.Media.DrawingGroup();   break;
                case KnownElements.DrawingImage: o = new System.Windows.Media.DrawingImage();   break; 
                case KnownElements.DrawingVisual: o = new System.Windows.Media.DrawingVisual();   break; 
                case KnownElements.DropShadowBitmapEffect: o = new System.Windows.Media.Effects.DropShadowBitmapEffect();   break;
                case KnownElements.Duration: o = new System.Windows.Duration();   break; 
                case KnownElements.DurationConverter: o = new System.Windows.DurationConverter();   break;
                case KnownElements.DynamicResourceExtension: o = new System.Windows.DynamicResourceExtension();   break;
                case KnownElements.DynamicResourceExtensionConverter: o = new System.Windows.DynamicResourceExtensionConverter();   break;
                case KnownElements.Ellipse: o = new System.Windows.Shapes.Ellipse();   break; 
                case KnownElements.EllipseGeometry: o = new System.Windows.Media.EllipseGeometry();   break;
                case KnownElements.EmbossBitmapEffect: o = new System.Windows.Media.Effects.EmbossBitmapEffect();   break; 
                case KnownElements.EmissiveMaterial: o = new System.Windows.Media.Media3D.EmissiveMaterial();   break; 
                case KnownElements.EventSetter: o = new System.Windows.EventSetter();   break;
                case KnownElements.EventTrigger: o = new System.Windows.EventTrigger();   break; 
                case KnownElements.Expander: o = new System.Windows.Controls.Expander();   break;
                case KnownElements.ExpressionConverter: o = new System.Windows.ExpressionConverter();   break;
                case KnownElements.Figure: o = new System.Windows.Documents.Figure();   break;
                case KnownElements.FigureLength: o = new System.Windows.FigureLength();   break; 
                case KnownElements.FigureLengthConverter: o = new System.Windows.FigureLengthConverter();   break;
                case KnownElements.FixedDocument: o = new System.Windows.Documents.FixedDocument();   break; 
                case KnownElements.FixedDocumentSequence: o = new System.Windows.Documents.FixedDocumentSequence();   break; 
                case KnownElements.FixedPage: o = new System.Windows.Documents.FixedPage();   break;
                case KnownElements.Floater: o = new System.Windows.Documents.Floater();   break; 
                case KnownElements.FlowDocument: o = new System.Windows.Documents.FlowDocument();   break;
                case KnownElements.FlowDocumentPageViewer: o = new System.Windows.Controls.FlowDocumentPageViewer();   break;
                case KnownElements.FlowDocumentReader: o = new System.Windows.Controls.FlowDocumentReader();   break;
                case KnownElements.FlowDocumentScrollViewer: o = new System.Windows.Controls.FlowDocumentScrollViewer();   break; 
                case KnownElements.FontFamily: o = new System.Windows.Media.FontFamily();   break;
                case KnownElements.FontFamilyConverter: o = new System.Windows.Media.FontFamilyConverter();   break; 
                case KnownElements.FontSizeConverter: o = new System.Windows.FontSizeConverter();   break; 
                case KnownElements.FontStretch: o = new System.Windows.FontStretch();   break;
                case KnownElements.FontStretchConverter: o = new System.Windows.FontStretchConverter();   break; 
                case KnownElements.FontStyle: o = new System.Windows.FontStyle();   break;
                case KnownElements.FontStyleConverter: o = new System.Windows.FontStyleConverter();   break;
                case KnownElements.FontWeight: o = new System.Windows.FontWeight();   break;
                case KnownElements.FontWeightConverter: o = new System.Windows.FontWeightConverter();   break; 
                case KnownElements.FormatConvertedBitmap: o = new System.Windows.Media.Imaging.FormatConvertedBitmap();   break;
                case KnownElements.Frame: o = new System.Windows.Controls.Frame();   break; 
                case KnownElements.FrameworkContentElement: o = new System.Windows.FrameworkContentElement();   break; 
                case KnownElements.FrameworkElement: o = new System.Windows.FrameworkElement();   break;
                case KnownElements.FrameworkElementFactory: o = new System.Windows.FrameworkElementFactory();   break; 
                case KnownElements.FrameworkPropertyMetadata: o = new System.Windows.FrameworkPropertyMetadata();   break;
                case KnownElements.GeneralTransformCollection: o = new System.Windows.Media.GeneralTransformCollection();   break;
                case KnownElements.GeneralTransformGroup: o = new System.Windows.Media.GeneralTransformGroup();   break;
                case KnownElements.GeometryCollection: o = new System.Windows.Media.GeometryCollection();   break; 
                case KnownElements.GeometryConverter: o = new System.Windows.Media.GeometryConverter();   break;
                case KnownElements.GeometryDrawing: o = new System.Windows.Media.GeometryDrawing();   break; 
                case KnownElements.GeometryGroup: o = new System.Windows.Media.GeometryGroup();   break; 
                case KnownElements.GeometryModel3D: o = new System.Windows.Media.Media3D.GeometryModel3D();   break;
                case KnownElements.GestureRecognizer: o = new System.Windows.Ink.GestureRecognizer();   break; 
                case KnownElements.GifBitmapEncoder: o = new System.Windows.Media.Imaging.GifBitmapEncoder();   break;
                case KnownElements.GlyphRun: o = new System.Windows.Media.GlyphRun();   break;
                case KnownElements.GlyphRunDrawing: o = new System.Windows.Media.GlyphRunDrawing();   break;
                case KnownElements.GlyphTypeface: o = new System.Windows.Media.GlyphTypeface();   break; 
                case KnownElements.Glyphs: o = new System.Windows.Documents.Glyphs();   break;
                case KnownElements.GradientStop: o = new System.Windows.Media.GradientStop();   break; 
                case KnownElements.GradientStopCollection: o = new System.Windows.Media.GradientStopCollection();   break; 
                case KnownElements.Grid: o = new System.Windows.Controls.Grid();   break;
                case KnownElements.GridLength: o = new System.Windows.GridLength();   break; 
                case KnownElements.GridLengthConverter: o = new System.Windows.GridLengthConverter();   break;
                case KnownElements.GridSplitter: o = new System.Windows.Controls.GridSplitter();   break;
                case KnownElements.GridView: o = new System.Windows.Controls.GridView();   break;
                case KnownElements.GridViewColumn: o = new System.Windows.Controls.GridViewColumn();   break; 
                case KnownElements.GridViewColumnHeader: o = new System.Windows.Controls.GridViewColumnHeader();   break;
                case KnownElements.GridViewHeaderRowPresenter: o = new System.Windows.Controls.GridViewHeaderRowPresenter();   break; 
                case KnownElements.GridViewRowPresenter: o = new System.Windows.Controls.GridViewRowPresenter();   break; 
                case KnownElements.GroupBox: o = new System.Windows.Controls.GroupBox();   break;
                case KnownElements.GroupItem: o = new System.Windows.Controls.GroupItem();   break; 
                case KnownElements.GuidConverter: o = new System.ComponentModel.GuidConverter();   break;
                case KnownElements.GuidelineSet: o = new System.Windows.Media.GuidelineSet();   break;
                case KnownElements.HeaderedContentControl: o = new System.Windows.Controls.HeaderedContentControl();   break;
                case KnownElements.HeaderedItemsControl: o = new System.Windows.Controls.HeaderedItemsControl();   break; 
                case KnownElements.HierarchicalDataTemplate: o = new System.Windows.HierarchicalDataTemplate();   break;
                case KnownElements.HostVisual: o = new System.Windows.Media.HostVisual();   break; 
                case KnownElements.Hyperlink: o = new System.Windows.Documents.Hyperlink();   break; 
                case KnownElements.Image: o = new System.Windows.Controls.Image();   break;
                case KnownElements.ImageBrush: o = new System.Windows.Media.ImageBrush();   break; 
                case KnownElements.ImageDrawing: o = new System.Windows.Media.ImageDrawing();   break;
                case KnownElements.ImageSourceConverter: o = new System.Windows.Media.ImageSourceConverter();   break;
                case KnownElements.InkCanvas: o = new System.Windows.Controls.InkCanvas();   break;
                case KnownElements.InkPresenter: o = new System.Windows.Controls.InkPresenter();   break; 
                case KnownElements.InlineUIContainer: o = new System.Windows.Documents.InlineUIContainer();   break;
                case KnownElements.InputScope: o = new System.Windows.Input.InputScope();   break; 
                case KnownElements.InputScopeConverter: o = new System.Windows.Input.InputScopeConverter();   break; 
                case KnownElements.InputScopeName: o = new System.Windows.Input.InputScopeName();   break;
                case KnownElements.InputScopeNameConverter: o = new System.Windows.Input.InputScopeNameConverter();   break; 
                case KnownElements.Int16Animation: o = new System.Windows.Media.Animation.Int16Animation();   break;
                case KnownElements.Int16AnimationUsingKeyFrames: o = new System.Windows.Media.Animation.Int16AnimationUsingKeyFrames();   break;
                case KnownElements.Int16Converter: o = new System.ComponentModel.Int16Converter();   break;
                case KnownElements.Int16KeyFrameCollection: o = new System.Windows.Media.Animation.Int16KeyFrameCollection();   break; 
                case KnownElements.Int32Animation: o = new System.Windows.Media.Animation.Int32Animation();   break;
                case KnownElements.Int32AnimationUsingKeyFrames: o = new System.Windows.Media.Animation.Int32AnimationUsingKeyFrames();   break; 
                case KnownElements.Int32Collection: o = new System.Windows.Media.Int32Collection();   break; 
                case KnownElements.Int32CollectionConverter: o = new System.Windows.Media.Int32CollectionConverter();   break;
                case KnownElements.Int32Converter: o = new System.ComponentModel.Int32Converter();   break; 
                case KnownElements.Int32KeyFrameCollection: o = new System.Windows.Media.Animation.Int32KeyFrameCollection();   break;
                case KnownElements.Int32Rect: o = new System.Windows.Int32Rect();   break;
                case KnownElements.Int32RectConverter: o = new System.Windows.Int32RectConverter();   break;
                case KnownElements.Int64Animation: o = new System.Windows.Media.Animation.Int64Animation();   break; 
                case KnownElements.Int64AnimationUsingKeyFrames: o = new System.Windows.Media.Animation.Int64AnimationUsingKeyFrames();   break;
                case KnownElements.Int64Converter: o = new System.ComponentModel.Int64Converter();   break; 
                case KnownElements.Int64KeyFrameCollection: o = new System.Windows.Media.Animation.Int64KeyFrameCollection();   break; 
                case KnownElements.Italic: o = new System.Windows.Documents.Italic();   break;
                case KnownElements.ItemsControl: o = new System.Windows.Controls.ItemsControl();   break; 
                case KnownElements.ItemsPanelTemplate: o = new System.Windows.Controls.ItemsPanelTemplate();   break;
                case KnownElements.ItemsPresenter: o = new System.Windows.Controls.ItemsPresenter();   break;
                case KnownElements.JournalEntryListConverter: o = new System.Windows.Navigation.JournalEntryListConverter();   break;
                case KnownElements.JournalEntryUnifiedViewConverter: o = new System.Windows.Navigation.JournalEntryUnifiedViewConverter();   break; 
                case KnownElements.JpegBitmapEncoder: o = new System.Windows.Media.Imaging.JpegBitmapEncoder();   break;
                case KnownElements.KeyBinding: o = new System.Windows.Input.KeyBinding();   break; 
                case KnownElements.KeyConverter: o = new System.Windows.Input.KeyConverter();   break; 
                case KnownElements.KeyGestureConverter: o = new System.Windows.Input.KeyGestureConverter();   break;
                case KnownElements.KeySpline: o = new System.Windows.Media.Animation.KeySpline();   break; 
                case KnownElements.KeySplineConverter: o = new System.Windows.KeySplineConverter();   break;
                case KnownElements.KeyTime: o = new System.Windows.Media.Animation.KeyTime();   break;
                case KnownElements.KeyTimeConverter: o = new System.Windows.KeyTimeConverter();   break;
                case KnownElements.Label: o = new System.Windows.Controls.Label();   break; 
                case KnownElements.LengthConverter: o = new System.Windows.LengthConverter();   break;
                case KnownElements.Line: o = new System.Windows.Shapes.Line();   break; 
                case KnownElements.LineBreak: o = new System.Windows.Documents.LineBreak();   break; 
                case KnownElements.LineGeometry: o = new System.Windows.Media.LineGeometry();   break;
                case KnownElements.LineSegment: o = new System.Windows.Media.LineSegment();   break; 
                case KnownElements.LinearByteKeyFrame: o = new System.Windows.Media.Animation.LinearByteKeyFrame();   break;
                case KnownElements.LinearColorKeyFrame: o = new System.Windows.Media.Animation.LinearColorKeyFrame();   break;
                case KnownElements.LinearDecimalKeyFrame: o = new System.Windows.Media.Animation.LinearDecimalKeyFrame();   break;
                case KnownElements.LinearDoubleKeyFrame: o = new System.Windows.Media.Animation.LinearDoubleKeyFrame();   break; 
                case KnownElements.LinearGradientBrush: o = new System.Windows.Media.LinearGradientBrush();   break;
                case KnownElements.LinearInt16KeyFrame: o = new System.Windows.Media.Animation.LinearInt16KeyFrame();   break; 
                case KnownElements.LinearInt32KeyFrame: o = new System.Windows.Media.Animation.LinearInt32KeyFrame();   break; 
                case KnownElements.LinearInt64KeyFrame: o = new System.Windows.Media.Animation.LinearInt64KeyFrame();   break;
                case KnownElements.LinearPoint3DKeyFrame: o = new System.Windows.Media.Animation.LinearPoint3DKeyFrame();   break; 
                case KnownElements.LinearPointKeyFrame: o = new System.Windows.Media.Animation.LinearPointKeyFrame();   break;
                case KnownElements.LinearQuaternionKeyFrame: o = new System.Windows.Media.Animation.LinearQuaternionKeyFrame();   break;
                case KnownElements.LinearRectKeyFrame: o = new System.Windows.Media.Animation.LinearRectKeyFrame();   break;
                case KnownElements.LinearRotation3DKeyFrame: o = new System.Windows.Media.Animation.LinearRotation3DKeyFrame();   break; 
                case KnownElements.LinearSingleKeyFrame: o = new System.Windows.Media.Animation.LinearSingleKeyFrame();   break;
                case KnownElements.LinearSizeKeyFrame: o = new System.Windows.Media.Animation.LinearSizeKeyFrame();   break; 
                case KnownElements.LinearThicknessKeyFrame: o = new System.Windows.Media.Animation.LinearThicknessKeyFrame();   break; 
                case KnownElements.LinearVector3DKeyFrame: o = new System.Windows.Media.Animation.LinearVector3DKeyFrame();   break;
                case KnownElements.LinearVectorKeyFrame: o = new System.Windows.Media.Animation.LinearVectorKeyFrame();   break; 
                case KnownElements.List: o = new System.Windows.Documents.List();   break;
                case KnownElements.ListBox: o = new System.Windows.Controls.ListBox();   break;
                case KnownElements.ListBoxItem: o = new System.Windows.Controls.ListBoxItem();   break;
                case KnownElements.ListItem: o = new System.Windows.Documents.ListItem();   break; 
                case KnownElements.ListView: o = new System.Windows.Controls.ListView();   break;
                case KnownElements.ListViewItem: o = new System.Windows.Controls.ListViewItem();   break; 
                case KnownElements.MaterialCollection: o = new System.Windows.Media.Media3D.MaterialCollection();   break; 
                case KnownElements.MaterialGroup: o = new System.Windows.Media.Media3D.MaterialGroup();   break;
                case KnownElements.Matrix: o = new System.Windows.Media.Matrix();   break; 
                case KnownElements.Matrix3D: o = new System.Windows.Media.Media3D.Matrix3D();   break;
                case KnownElements.Matrix3DConverter: o = new System.Windows.Media.Media3D.Matrix3DConverter();   break;
                case KnownElements.MatrixAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.MatrixAnimationUsingKeyFrames();   break;
                case KnownElements.MatrixAnimationUsingPath: o = new System.Windows.Media.Animation.MatrixAnimationUsingPath();   break; 
                case KnownElements.MatrixCamera: o = new System.Windows.Media.Media3D.MatrixCamera();   break;
                case KnownElements.MatrixConverter: o = new System.Windows.Media.MatrixConverter();   break; 
                case KnownElements.MatrixKeyFrameCollection: o = new System.Windows.Media.Animation.MatrixKeyFrameCollection();   break; 
                case KnownElements.MatrixTransform: o = new System.Windows.Media.MatrixTransform();   break;
                case KnownElements.MatrixTransform3D: o = new System.Windows.Media.Media3D.MatrixTransform3D();   break; 
                case KnownElements.MediaElement: o = new System.Windows.Controls.MediaElement();   break;
                case KnownElements.MediaPlayer: o = new System.Windows.Media.MediaPlayer();   break;
                case KnownElements.MediaTimeline: o = new System.Windows.Media.MediaTimeline();   break;
                case KnownElements.Menu: o = new System.Windows.Controls.Menu();   break; 
                case KnownElements.MenuItem: o = new System.Windows.Controls.MenuItem();   break;
                case KnownElements.MenuScrollingVisibilityConverter: o = new System.Windows.Controls.MenuScrollingVisibilityConverter();   break; 
                case KnownElements.MeshGeometry3D: o = new System.Windows.Media.Media3D.MeshGeometry3D();   break; 
                case KnownElements.Model3DCollection: o = new System.Windows.Media.Media3D.Model3DCollection();   break;
                case KnownElements.Model3DGroup: o = new System.Windows.Media.Media3D.Model3DGroup();   break; 
                case KnownElements.ModelVisual3D: o = new System.Windows.Media.Media3D.ModelVisual3D();   break;
                case KnownElements.ModifierKeysConverter: o = new System.Windows.Input.ModifierKeysConverter();   break;
                case KnownElements.MouseActionConverter: o = new System.Windows.Input.MouseActionConverter();   break;
                case KnownElements.MouseBinding: o = new System.Windows.Input.MouseBinding();   break; 
                case KnownElements.MouseGesture: o = new System.Windows.Input.MouseGesture();   break;
                case KnownElements.MouseGestureConverter: o = new System.Windows.Input.MouseGestureConverter();   break; 
                case KnownElements.MultiBinding: o = new System.Windows.Data.MultiBinding();   break; 
                case KnownElements.MultiDataTrigger: o = new System.Windows.MultiDataTrigger();   break;
                case KnownElements.MultiTrigger: o = new System.Windows.MultiTrigger();   break; 
                case KnownElements.NameScope: o = new System.Windows.NameScope();   break;
                case KnownElements.NavigationWindow: o = new System.Windows.Navigation.NavigationWindow();   break;
                case KnownElements.NullExtension: o = new System.Windows.Markup.NullExtension();   break;
                case KnownElements.NullableBoolConverter: o = new System.Windows.NullableBoolConverter();   break; 
                case KnownElements.NumberSubstitution: o = new System.Windows.Media.NumberSubstitution();   break;
                case KnownElements.Object: o = new System.Object();   break; 
                case KnownElements.ObjectAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.ObjectAnimationUsingKeyFrames();   break; 
                case KnownElements.ObjectDataProvider: o = new System.Windows.Data.ObjectDataProvider();   break;
                case KnownElements.ObjectKeyFrameCollection: o = new System.Windows.Media.Animation.ObjectKeyFrameCollection();   break; 
                case KnownElements.OrthographicCamera: o = new System.Windows.Media.Media3D.OrthographicCamera();   break;
                case KnownElements.OuterGlowBitmapEffect: o = new System.Windows.Media.Effects.OuterGlowBitmapEffect();   break;
                case KnownElements.Page: o = new System.Windows.Controls.Page();   break;
                case KnownElements.PageContent: o = new System.Windows.Documents.PageContent();   break; 
                case KnownElements.Paragraph: o = new System.Windows.Documents.Paragraph();   break;
                case KnownElements.ParallelTimeline: o = new System.Windows.Media.Animation.ParallelTimeline();   break; 
                case KnownElements.ParserContext: o = new System.Windows.Markup.ParserContext();   break; 
                case KnownElements.PasswordBox: o = new System.Windows.Controls.PasswordBox();   break;
                case KnownElements.Path: o = new System.Windows.Shapes.Path();   break; 
                case KnownElements.PathFigure: o = new System.Windows.Media.PathFigure();   break;
                case KnownElements.PathFigureCollection: o = new System.Windows.Media.PathFigureCollection();   break;
                case KnownElements.PathFigureCollectionConverter: o = new System.Windows.Media.PathFigureCollectionConverter();   break;
                case KnownElements.PathGeometry: o = new System.Windows.Media.PathGeometry();   break; 
                case KnownElements.PathSegmentCollection: o = new System.Windows.Media.PathSegmentCollection();   break;
                case KnownElements.PauseStoryboard: o = new System.Windows.Media.Animation.PauseStoryboard();   break; 
                case KnownElements.Pen: o = new System.Windows.Media.Pen();   break; 
                case KnownElements.PerspectiveCamera: o = new System.Windows.Media.Media3D.PerspectiveCamera();   break;
                case KnownElements.PixelFormat: o = new System.Windows.Media.PixelFormat();   break; 
                case KnownElements.PixelFormatConverter: o = new System.Windows.Media.PixelFormatConverter();   break;
                case KnownElements.PngBitmapEncoder: o = new System.Windows.Media.Imaging.PngBitmapEncoder();   break;
                case KnownElements.Point: o = new System.Windows.Point();   break;
                case KnownElements.Point3D: o = new System.Windows.Media.Media3D.Point3D();   break; 
                case KnownElements.Point3DAnimation: o = new System.Windows.Media.Animation.Point3DAnimation();   break;
                case KnownElements.Point3DAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.Point3DAnimationUsingKeyFrames();   break; 
                case KnownElements.Point3DCollection: o = new System.Windows.Media.Media3D.Point3DCollection();   break; 
                case KnownElements.Point3DCollectionConverter: o = new System.Windows.Media.Media3D.Point3DCollectionConverter();   break;
                case KnownElements.Point3DConverter: o = new System.Windows.Media.Media3D.Point3DConverter();   break; 
                case KnownElements.Point3DKeyFrameCollection: o = new System.Windows.Media.Animation.Point3DKeyFrameCollection();   break;
                case KnownElements.Point4D: o = new System.Windows.Media.Media3D.Point4D();   break;
                case KnownElements.Point4DConverter: o = new System.Windows.Media.Media3D.Point4DConverter();   break;
                case KnownElements.PointAnimation: o = new System.Windows.Media.Animation.PointAnimation();   break; 
                case KnownElements.PointAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.PointAnimationUsingKeyFrames();   break;
                case KnownElements.PointAnimationUsingPath: o = new System.Windows.Media.Animation.PointAnimationUsingPath();   break; 
                case KnownElements.PointCollection: o = new System.Windows.Media.PointCollection();   break; 
                case KnownElements.PointCollectionConverter: o = new System.Windows.Media.PointCollectionConverter();   break;
                case KnownElements.PointConverter: o = new System.Windows.PointConverter();   break; 
                case KnownElements.PointIListConverter: o = new System.Windows.Media.Converters.PointIListConverter();   break;
                case KnownElements.PointKeyFrameCollection: o = new System.Windows.Media.Animation.PointKeyFrameCollection();   break;
                case KnownElements.PointLight: o = new System.Windows.Media.Media3D.PointLight();   break;
                case KnownElements.PolyBezierSegment: o = new System.Windows.Media.PolyBezierSegment();   break; 
                case KnownElements.PolyLineSegment: o = new System.Windows.Media.PolyLineSegment();   break;
                case KnownElements.PolyQuadraticBezierSegment: o = new System.Windows.Media.PolyQuadraticBezierSegment();   break; 
                case KnownElements.Polygon: o = new System.Windows.Shapes.Polygon();   break; 
                case KnownElements.Polyline: o = new System.Windows.Shapes.Polyline();   break;
                case KnownElements.Popup: o = new System.Windows.Controls.Primitives.Popup();   break; 
                case KnownElements.PriorityBinding: o = new System.Windows.Data.PriorityBinding();   break;
                case KnownElements.ProgressBar: o = new System.Windows.Controls.ProgressBar();   break;
                case KnownElements.PropertyPathConverter: o = new System.Windows.PropertyPathConverter();   break;
                case KnownElements.QuadraticBezierSegment: o = new System.Windows.Media.QuadraticBezierSegment();   break; 
                case KnownElements.Quaternion: o = new System.Windows.Media.Media3D.Quaternion();   break;
                case KnownElements.QuaternionAnimation: o = new System.Windows.Media.Animation.QuaternionAnimation();   break; 
                case KnownElements.QuaternionAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.QuaternionAnimationUsingKeyFrames();   break; 
                case KnownElements.QuaternionConverter: o = new System.Windows.Media.Media3D.QuaternionConverter();   break;
                case KnownElements.QuaternionKeyFrameCollection: o = new System.Windows.Media.Animation.QuaternionKeyFrameCollection();   break; 
                case KnownElements.QuaternionRotation3D: o = new System.Windows.Media.Media3D.QuaternionRotation3D();   break;
                case KnownElements.RadialGradientBrush: o = new System.Windows.Media.RadialGradientBrush();   break;
                case KnownElements.RadioButton: o = new System.Windows.Controls.RadioButton();   break;
                case KnownElements.Rect: o = new System.Windows.Rect();   break; 
                case KnownElements.Rect3D: o = new System.Windows.Media.Media3D.Rect3D();   break;
                case KnownElements.Rect3DConverter: o = new System.Windows.Media.Media3D.Rect3DConverter();   break; 
                case KnownElements.RectAnimation: o = new System.Windows.Media.Animation.RectAnimation();   break; 
                case KnownElements.RectAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.RectAnimationUsingKeyFrames();   break;
                case KnownElements.RectConverter: o = new System.Windows.RectConverter();   break; 
                case KnownElements.RectKeyFrameCollection: o = new System.Windows.Media.Animation.RectKeyFrameCollection();   break;
                case KnownElements.Rectangle: o = new System.Windows.Shapes.Rectangle();   break;
                case KnownElements.RectangleGeometry: o = new System.Windows.Media.RectangleGeometry();   break;
                case KnownElements.RelativeSource: o = new System.Windows.Data.RelativeSource();   break; 
                case KnownElements.RemoveStoryboard: o = new System.Windows.Media.Animation.RemoveStoryboard();   break;
                case KnownElements.RepeatBehavior: o = new System.Windows.Media.Animation.RepeatBehavior();   break; 
                case KnownElements.RepeatBehaviorConverter: o = new System.Windows.Media.Animation.RepeatBehaviorConverter();   break; 
                case KnownElements.RepeatButton: o = new System.Windows.Controls.Primitives.RepeatButton();   break;
                case KnownElements.ResizeGrip: o = new System.Windows.Controls.Primitives.ResizeGrip();   break; 
                case KnownElements.ResourceDictionary: o = new System.Windows.ResourceDictionary();   break;
                case KnownElements.ResumeStoryboard: o = new System.Windows.Media.Animation.ResumeStoryboard();   break;
                case KnownElements.RichTextBox: o = new System.Windows.Controls.RichTextBox();   break;
                case KnownElements.RotateTransform: o = new System.Windows.Media.RotateTransform();   break; 
                case KnownElements.RotateTransform3D: o = new System.Windows.Media.Media3D.RotateTransform3D();   break;
                case KnownElements.Rotation3DAnimation: o = new System.Windows.Media.Animation.Rotation3DAnimation();   break; 
                case KnownElements.Rotation3DAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.Rotation3DAnimationUsingKeyFrames();   break; 
                case KnownElements.Rotation3DKeyFrameCollection: o = new System.Windows.Media.Animation.Rotation3DKeyFrameCollection();   break;
                case KnownElements.RoutedCommand: o = new System.Windows.Input.RoutedCommand();   break; 
                case KnownElements.RoutedEventConverter: o = new System.Windows.Markup.RoutedEventConverter();   break;
                case KnownElements.RoutedUICommand: o = new System.Windows.Input.RoutedUICommand();   break;
                case KnownElements.RowDefinition: o = new System.Windows.Controls.RowDefinition();   break;
                case KnownElements.Run: o = new System.Windows.Documents.Run();   break; 
                case KnownElements.SByteConverter: o = new System.ComponentModel.SByteConverter();   break;
                case KnownElements.ScaleTransform: o = new System.Windows.Media.ScaleTransform();   break; 
                case KnownElements.ScaleTransform3D: o = new System.Windows.Media.Media3D.ScaleTransform3D();   break; 
                case KnownElements.ScrollBar: o = new System.Windows.Controls.Primitives.ScrollBar();   break;
                case KnownElements.ScrollContentPresenter: o = new System.Windows.Controls.ScrollContentPresenter();   break; 
                case KnownElements.ScrollViewer: o = new System.Windows.Controls.ScrollViewer();   break;
                case KnownElements.Section: o = new System.Windows.Documents.Section();   break;
                case KnownElements.SeekStoryboard: o = new System.Windows.Media.Animation.SeekStoryboard();   break;
                case KnownElements.Separator: o = new System.Windows.Controls.Separator();   break; 
                case KnownElements.SetStoryboardSpeedRatio: o = new System.Windows.Media.Animation.SetStoryboardSpeedRatio();   break;
                case KnownElements.Setter: o = new System.Windows.Setter();   break; 
                case KnownElements.SingleAnimation: o = new System.Windows.Media.Animation.SingleAnimation();   break; 
                case KnownElements.SingleAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.SingleAnimationUsingKeyFrames();   break;
                case KnownElements.SingleConverter: o = new System.ComponentModel.SingleConverter();   break; 
                case KnownElements.SingleKeyFrameCollection: o = new System.Windows.Media.Animation.SingleKeyFrameCollection();   break;
                case KnownElements.Size: o = new System.Windows.Size();   break;
                case KnownElements.Size3D: o = new System.Windows.Media.Media3D.Size3D();   break;
                case KnownElements.Size3DConverter: o = new System.Windows.Media.Media3D.Size3DConverter();   break; 
                case KnownElements.SizeAnimation: o = new System.Windows.Media.Animation.SizeAnimation();   break;
                case KnownElements.SizeAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.SizeAnimationUsingKeyFrames();   break; 
                case KnownElements.SizeConverter: o = new System.Windows.SizeConverter();   break; 
                case KnownElements.SizeKeyFrameCollection: o = new System.Windows.Media.Animation.SizeKeyFrameCollection();   break;
                case KnownElements.SkewTransform: o = new System.Windows.Media.SkewTransform();   break; 
                case KnownElements.SkipStoryboardToFill: o = new System.Windows.Media.Animation.SkipStoryboardToFill();   break;
                case KnownElements.Slider: o = new System.Windows.Controls.Slider();   break;
                case KnownElements.SolidColorBrush: o = new System.Windows.Media.SolidColorBrush();   break;
                case KnownElements.SoundPlayerAction: o = new System.Windows.Controls.SoundPlayerAction();   break; 
                case KnownElements.Span: o = new System.Windows.Documents.Span();   break;
                case KnownElements.SpecularMaterial: o = new System.Windows.Media.Media3D.SpecularMaterial();   break; 
                case KnownElements.SplineByteKeyFrame: o = new System.Windows.Media.Animation.SplineByteKeyFrame();   break; 
                case KnownElements.SplineColorKeyFrame: o = new System.Windows.Media.Animation.SplineColorKeyFrame();   break;
                case KnownElements.SplineDecimalKeyFrame: o = new System.Windows.Media.Animation.SplineDecimalKeyFrame();   break; 
                case KnownElements.SplineDoubleKeyFrame: o = new System.Windows.Media.Animation.SplineDoubleKeyFrame();   break;
                case KnownElements.SplineInt16KeyFrame: o = new System.Windows.Media.Animation.SplineInt16KeyFrame();   break;
                case KnownElements.SplineInt32KeyFrame: o = new System.Windows.Media.Animation.SplineInt32KeyFrame();   break;
                case KnownElements.SplineInt64KeyFrame: o = new System.Windows.Media.Animation.SplineInt64KeyFrame();   break; 
                case KnownElements.SplinePoint3DKeyFrame: o = new System.Windows.Media.Animation.SplinePoint3DKeyFrame();   break;
                case KnownElements.SplinePointKeyFrame: o = new System.Windows.Media.Animation.SplinePointKeyFrame();   break; 
                case KnownElements.SplineQuaternionKeyFrame: o = new System.Windows.Media.Animation.SplineQuaternionKeyFrame();   break; 
                case KnownElements.SplineRectKeyFrame: o = new System.Windows.Media.Animation.SplineRectKeyFrame();   break;
                case KnownElements.SplineRotation3DKeyFrame: o = new System.Windows.Media.Animation.SplineRotation3DKeyFrame();   break; 
                case KnownElements.SplineSingleKeyFrame: o = new System.Windows.Media.Animation.SplineSingleKeyFrame();   break;
                case KnownElements.SplineSizeKeyFrame: o = new System.Windows.Media.Animation.SplineSizeKeyFrame();   break;
                case KnownElements.SplineThicknessKeyFrame: o = new System.Windows.Media.Animation.SplineThicknessKeyFrame();   break;
                case KnownElements.SplineVector3DKeyFrame: o = new System.Windows.Media.Animation.SplineVector3DKeyFrame();   break; 
                case KnownElements.SplineVectorKeyFrame: o = new System.Windows.Media.Animation.SplineVectorKeyFrame();   break;
                case KnownElements.SpotLight: o = new System.Windows.Media.Media3D.SpotLight();   break; 
                case KnownElements.StackPanel: o = new System.Windows.Controls.StackPanel();   break; 
                case KnownElements.StaticExtension: o = new System.Windows.Markup.StaticExtension();   break;
                case KnownElements.StaticResourceExtension: o = new System.Windows.StaticResourceExtension();   break; 
                case KnownElements.StatusBar: o = new System.Windows.Controls.Primitives.StatusBar();   break;
                case KnownElements.StatusBarItem: o = new System.Windows.Controls.Primitives.StatusBarItem();   break;
                case KnownElements.StopStoryboard: o = new System.Windows.Media.Animation.StopStoryboard();   break;
                case KnownElements.Storyboard: o = new System.Windows.Media.Animation.Storyboard();   break; 
                case KnownElements.StreamGeometry: o = new System.Windows.Media.StreamGeometry();   break;
                case KnownElements.StreamResourceInfo: o = new System.Windows.Resources.StreamResourceInfo();   break; 
                case KnownElements.StringAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.StringAnimationUsingKeyFrames();   break; 
                case KnownElements.StringConverter: o = new System.ComponentModel.StringConverter();   break;
                case KnownElements.StringKeyFrameCollection: o = new System.Windows.Media.Animation.StringKeyFrameCollection();   break; 
                case KnownElements.StrokeCollection: o = new System.Windows.Ink.StrokeCollection();   break;
                case KnownElements.StrokeCollectionConverter: o = new System.Windows.StrokeCollectionConverter();   break;
                case KnownElements.Style: o = new System.Windows.Style();   break;
                case KnownElements.TabControl: o = new System.Windows.Controls.TabControl();   break; 
                case KnownElements.TabItem: o = new System.Windows.Controls.TabItem();   break;
                case KnownElements.TabPanel: o = new System.Windows.Controls.Primitives.TabPanel();   break; 
                case KnownElements.Table: o = new System.Windows.Documents.Table();   break; 
                case KnownElements.TableCell: o = new System.Windows.Documents.TableCell();   break;
                case KnownElements.TableColumn: o = new System.Windows.Documents.TableColumn();   break; 
                case KnownElements.TableRow: o = new System.Windows.Documents.TableRow();   break;
                case KnownElements.TableRowGroup: o = new System.Windows.Documents.TableRowGroup();   break;
                case KnownElements.TemplateBindingExpressionConverter: o = new System.Windows.TemplateBindingExpressionConverter();   break;
                case KnownElements.TemplateBindingExtension: o = new System.Windows.TemplateBindingExtension();   break; 
                case KnownElements.TemplateBindingExtensionConverter: o = new System.Windows.TemplateBindingExtensionConverter();   break;
                case KnownElements.TemplateKeyConverter: o = new System.Windows.Markup.TemplateKeyConverter();   break; 
                case KnownElements.TextBlock: o = new System.Windows.Controls.TextBlock();   break; 
                case KnownElements.TextBox: o = new System.Windows.Controls.TextBox();   break;
                case KnownElements.TextDecoration: o = new System.Windows.TextDecoration();   break; 
                case KnownElements.TextDecorationCollection: o = new System.Windows.TextDecorationCollection();   break;
                case KnownElements.TextDecorationCollectionConverter: o = new System.Windows.TextDecorationCollectionConverter();   break;
                case KnownElements.TextEffect: o = new System.Windows.Media.TextEffect();   break;
                case KnownElements.TextEffectCollection: o = new System.Windows.Media.TextEffectCollection();   break; 
                case KnownElements.ThemeDictionaryExtension: o = new System.Windows.ThemeDictionaryExtension();   break;
                case KnownElements.Thickness: o = new System.Windows.Thickness();   break; 
                case KnownElements.ThicknessAnimation: o = new System.Windows.Media.Animation.ThicknessAnimation();   break; 
                case KnownElements.ThicknessAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.ThicknessAnimationUsingKeyFrames();   break;
                case KnownElements.ThicknessConverter: o = new System.Windows.ThicknessConverter();   break; 
                case KnownElements.ThicknessKeyFrameCollection: o = new System.Windows.Media.Animation.ThicknessKeyFrameCollection();   break;
                case KnownElements.Thumb: o = new System.Windows.Controls.Primitives.Thumb();   break;
                case KnownElements.TickBar: o = new System.Windows.Controls.Primitives.TickBar();   break;
                case KnownElements.TiffBitmapEncoder: o = new System.Windows.Media.Imaging.TiffBitmapEncoder();   break; 
                case KnownElements.TimeSpanConverter: o = new System.ComponentModel.TimeSpanConverter();   break;
                case KnownElements.TimelineCollection: o = new System.Windows.Media.Animation.TimelineCollection();   break; 
                case KnownElements.ToggleButton: o = new System.Windows.Controls.Primitives.ToggleButton();   break; 
                case KnownElements.ToolBar: o = new System.Windows.Controls.ToolBar();   break;
                case KnownElements.ToolBarOverflowPanel: o = new System.Windows.Controls.Primitives.ToolBarOverflowPanel();   break; 
                case KnownElements.ToolBarPanel: o = new System.Windows.Controls.Primitives.ToolBarPanel();   break;
                case KnownElements.ToolBarTray: o = new System.Windows.Controls.ToolBarTray();   break;
                case KnownElements.ToolTip: o = new System.Windows.Controls.ToolTip();   break;
                case KnownElements.Track: o = new System.Windows.Controls.Primitives.Track();   break; 
                case KnownElements.Transform3DCollection: o = new System.Windows.Media.Media3D.Transform3DCollection();   break;
                case KnownElements.Transform3DGroup: o = new System.Windows.Media.Media3D.Transform3DGroup();   break; 
                case KnownElements.TransformCollection: o = new System.Windows.Media.TransformCollection();   break; 
                case KnownElements.TransformConverter: o = new System.Windows.Media.TransformConverter();   break;
                case KnownElements.TransformGroup: o = new System.Windows.Media.TransformGroup();   break; 
                case KnownElements.TransformedBitmap: o = new System.Windows.Media.Imaging.TransformedBitmap();   break;
                case KnownElements.TranslateTransform: o = new System.Windows.Media.TranslateTransform();   break;
                case KnownElements.TranslateTransform3D: o = new System.Windows.Media.Media3D.TranslateTransform3D();   break;
                case KnownElements.TreeView: o = new System.Windows.Controls.TreeView();   break; 
                case KnownElements.TreeViewItem: o = new System.Windows.Controls.TreeViewItem();   break;
                case KnownElements.Trigger: o = new System.Windows.Trigger();   break; 
                case KnownElements.TypeExtension: o = new System.Windows.Markup.TypeExtension();   break; 
                case KnownElements.TypeTypeConverter: o = new System.Windows.Markup.TypeTypeConverter();   break;
                case KnownElements.UIElement: o = new System.Windows.UIElement();   break; 
                case KnownElements.UInt16Converter: o = new System.ComponentModel.UInt16Converter();   break;
                case KnownElements.UInt32Converter: o = new System.ComponentModel.UInt32Converter();   break;
                case KnownElements.UInt64Converter: o = new System.ComponentModel.UInt64Converter();   break;
                case KnownElements.UShortIListConverter: o = new System.Windows.Media.Converters.UShortIListConverter();   break; 
                case KnownElements.Underline: o = new System.Windows.Documents.Underline();   break;
                case KnownElements.UniformGrid: o = new System.Windows.Controls.Primitives.UniformGrid();   break; 
                case KnownElements.UriTypeConverter: o = new System.UriTypeConverter();   break; 
                case KnownElements.UserControl: o = new System.Windows.Controls.UserControl();   break;
                case KnownElements.Vector: o = new System.Windows.Vector();   break; 
                case KnownElements.Vector3D: o = new System.Windows.Media.Media3D.Vector3D();   break;
                case KnownElements.Vector3DAnimation: o = new System.Windows.Media.Animation.Vector3DAnimation();   break;
                case KnownElements.Vector3DAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.Vector3DAnimationUsingKeyFrames();   break;
                case KnownElements.Vector3DCollection: o = new System.Windows.Media.Media3D.Vector3DCollection();   break; 
                case KnownElements.Vector3DCollectionConverter: o = new System.Windows.Media.Media3D.Vector3DCollectionConverter();   break;
                case KnownElements.Vector3DConverter: o = new System.Windows.Media.Media3D.Vector3DConverter();   break; 
                case KnownElements.Vector3DKeyFrameCollection: o = new System.Windows.Media.Animation.Vector3DKeyFrameCollection();   break; 
                case KnownElements.VectorAnimation: o = new System.Windows.Media.Animation.VectorAnimation();   break;
                case KnownElements.VectorAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.VectorAnimationUsingKeyFrames();   break; 
                case KnownElements.VectorCollection: o = new System.Windows.Media.VectorCollection();   break;
                case KnownElements.VectorCollectionConverter: o = new System.Windows.Media.VectorCollectionConverter();   break;
                case KnownElements.VectorConverter: o = new System.Windows.VectorConverter();   break;
                case KnownElements.VectorKeyFrameCollection: o = new System.Windows.Media.Animation.VectorKeyFrameCollection();   break; 
                case KnownElements.VideoDrawing: o = new System.Windows.Media.VideoDrawing();   break;
                case KnownElements.Viewbox: o = new System.Windows.Controls.Viewbox();   break; 
                case KnownElements.Viewport3D: o = new System.Windows.Controls.Viewport3D();   break; 
                case KnownElements.Viewport3DVisual: o = new System.Windows.Media.Media3D.Viewport3DVisual();   break;
                case KnownElements.VirtualizingStackPanel: o = new System.Windows.Controls.VirtualizingStackPanel();   break; 
                case KnownElements.VisualBrush: o = new System.Windows.Media.VisualBrush();   break;
                case KnownElements.Window: o = new System.Windows.Window();   break;
                case KnownElements.WmpBitmapEncoder: o = new System.Windows.Media.Imaging.WmpBitmapEncoder();   break;
                case KnownElements.WrapPanel: o = new System.Windows.Controls.WrapPanel();   break; 
                case KnownElements.XamlBrushSerializer: o = new System.Windows.Markup.XamlBrushSerializer();   break;
                case KnownElements.XamlInt32CollectionSerializer: o = new System.Windows.Markup.XamlInt32CollectionSerializer();   break; 
                case KnownElements.XamlPathDataSerializer: o = new System.Windows.Markup.XamlPathDataSerializer();   break; 
                case KnownElements.XamlPoint3DCollectionSerializer: o = new System.Windows.Markup.XamlPoint3DCollectionSerializer();   break;
                case KnownElements.XamlPointCollectionSerializer: o = new System.Windows.Markup.XamlPointCollectionSerializer();   break; 
                case KnownElements.XamlStyleSerializer: o = new System.Windows.Markup.XamlStyleSerializer();   break;
                case KnownElements.XamlTemplateSerializer: o = new System.Windows.Markup.XamlTemplateSerializer();   break;
                case KnownElements.XamlVector3DCollectionSerializer: o = new System.Windows.Markup.XamlVector3DCollectionSerializer();   break;
                case KnownElements.XmlDataProvider: o = new System.Windows.Data.XmlDataProvider();   break; 
                case KnownElements.XmlLanguageConverter: o = new System.Windows.Markup.XmlLanguageConverter();   break;
                case KnownElements.XmlNamespaceMapping: o = new System.Windows.Data.XmlNamespaceMapping();   break; 
                case KnownElements.ZoomPercentageConverter: o = new System.Windows.Documents.ZoomPercentageConverter();   break; 
            }
            return o; 
        }
コード例 #2
0
        private static Geometry3D GetDiskOnConeModel(Tool tool, Point3D position, Vector3D direction)
        {
            var t       = tool as DiskOnConeTool;
            var builder = new MeshBuilder();
            var d       = Math.Abs(t.BodyThickness - t.CuttingThickness) / 2.0;
            var r1      = t.Diameter / 2.0 - t.CuttingRadialThickness;
            var p1      = position + direction * t.PostponemntLength;
            var profile = new SharpDX.Vector2[]
            {
                new SharpDX.Vector2(0.0f, (float)(t.PostponemntDiameter / 2.0)),
                new SharpDX.Vector2(0.0f, (float)r1),
                new SharpDX.Vector2((float)(-d), (float)r1),
                new SharpDX.Vector2((float)(-d), (float)(t.Diameter / 2.0)),
                new SharpDX.Vector2((float)(t.BodyThickness + d), (float)(t.Diameter / 2.0)),
                new SharpDX.Vector2((float)(t.BodyThickness + d), (float)r1),
                new SharpDX.Vector2((float)t.BodyThickness, (float)r1),
                new SharpDX.Vector2((float)t.BodyThickness, (float)(t.PostponemntDiameter / 2.0)),
            };

            builder.AddRevolvedGeometry(profile.ToList(),
                                        null,
                                        p1.ToVector3(),
                                        direction.ToVector3(),
                                        100);
            builder.AddCylinder(position.ToVector3(),
                                p1.ToVector3(),
                                t.PostponemntDiameter,
                                20);

            return(builder.ToMesh());
        }
コード例 #3
0
        private static Geometry3D GetDiskModel(Tool tool, Point3D position, Vector3D direction)
        {
            var t       = tool as DiskTool;
            var builder = new MeshBuilder();
            var d       = Math.Abs(t.BodyThickness - t.CuttingThickness) / 2.0;
            var r1      = t.Diameter / 2.0 - t.CuttingRadialThickness;
            var profile = new[]
            {
                new SharpDX.Vector2(0.0f, 10.0f),
                new SharpDX.Vector2(0.0f, (float)r1),
                new SharpDX.Vector2((float)(-d), (float)r1),
                new SharpDX.Vector2((float)(-d), (float)(t.Diameter / 2.0)),
                new SharpDX.Vector2((float)(t.BodyThickness + d), (float)(t.Diameter / 2.0)),
                new SharpDX.Vector2((float)(t.BodyThickness + d), (float)r1),
                new SharpDX.Vector2((float)t.BodyThickness, (float)r1),
                new SharpDX.Vector2((float)t.BodyThickness, 10.0f)
            };

            builder.AddRevolvedGeometry(profile.ToList(),
                                        null,
                                        position.ToVector3(),
                                        direction.ToVector3(),
                                        100);

            return(builder.ToMesh());
        }
コード例 #4
0
        protected internal override bool TestPosture(Microsoft.Kinect.Skeleton s)
        {
            /*
             * var handRight = s.Joints[Microsoft.Kinect.JointType.HandRight];
             * var shoulderCenter = s.Joints[Microsoft.Kinect.JointType.ShoulderCenter];
             * var shoulderLeft = s.Joints[Microsoft.Kinect.JointType.ShoulderLeft];
             * var shoulderRight = s.Joints[Microsoft.Kinect.JointType.ShoulderRight];
             * if (handRight.TrackingState != Microsoft.Kinect.JointTrackingState.Tracked
             || shoulderCenter.TrackingState != Microsoft.Kinect.JointTrackingState.Tracked
             || shoulderLeft.TrackingState != Microsoft.Kinect.JointTrackingState.Tracked
             || shoulderRight.TrackingState != Microsoft.Kinect.JointTrackingState.Tracked
             || )
             || return false;
             ||
             ||var handRightPosition = s.Joints[Microsoft.Kinect.JointType.HandRight].Position;
             ||return handRightPosition.Y > s.Joints[Microsoft.Kinect.JointType.ShoulderCenter].Position.Y
             ||     //&& handRightPosition.X > s.Joints[Microsoft.Kinect.JointType.ShoulderLeft].Position.X
             ||     && handRightPosition.X > s.Joints[Microsoft.Kinect.JointType.Head].Position.X;  */

            var handRight      = s.Joints[Microsoft.Kinect.JointType.HandRight];
            var shoulderCenter = s.Joints[Microsoft.Kinect.JointType.ShoulderCenter];

            if (handRight.TrackingState != Microsoft.Kinect.JointTrackingState.Tracked || shoulderCenter.TrackingState != Microsoft.Kinect.JointTrackingState.Tracked)
            {
                return(false);
            }
            var handRightPosition      = handRight.Position;
            var shoulderCenterPosition = shoulderCenter.Position;

            System.Windows.Media.Media3D.Vector3D vector = new System.Windows.Media.Media3D.Vector3D(handRightPosition.X - shoulderCenterPosition.X,
                                                                                                     handRightPosition.Y - shoulderCenterPosition.Y,
                                                                                                     handRightPosition.Z - shoulderCenterPosition.Z);
            return(vector.Length < 0.3);
        }
コード例 #5
0
        public static Geometry3D GetCountersinkModel(Tool tool, Point3D position, Vector3D direction)
        {
            const double hSvasatore = 10.0;
            var          t          = tool as CountersinkTool;
            var          builder    = new MeshBuilder();
            var          p1         = position + direction * (t.Length1 - hSvasatore);
            var          p12        = position + direction * t.Length1;
            var          p2         = position + direction * (t.Length1 + t.Length2);
            var          p3         = position + direction * (t.Length1 + t.Length2 + t.Length3);

            builder.AddCylinder(position.ToVector3(),
                                p1.ToVector3(),
                                t.Diameter1 / 2.0);
            builder.AddCylinder(p1.ToVector3(),
                                p12.ToVector3(),
                                t.Diameter2 / 2.0);
            builder.AddCone(p12.ToVector3(),
                            direction.ToVector3(),
                            t.Diameter2 / 2.0,
                            t.Diameter1 / 2.0,
                            t.Length2,
                            false,
                            false,
                            20);
            builder.AddCylinder(p2.ToVector3(),
                                p3.ToVector3(),
                                t.Diameter1 / 2.0);

            return(builder.ToMesh());
        }
コード例 #6
0
        ///<summary>得到从一点到另一点的保持up为北的变换矩阵</summary>
        public static Matrix getMatrixP2P(Vector3 pstart, Vector3 pend, STRUCT_EarthPara earthpara)
        {
            Matrix matrix = Matrix.Identity;

            if (earthpara.SceneMode == ESceneMode.地球)
            {
                double angle1 = Math.Atan(pstart.X / pstart.Z);
                double angle2 = Math.Atan(pend.X / pend.Z);
                if (angle2 != angle1)
                {
                    matrix = Matrix.CreateRotationY((float)(angle2 - angle1));
                }

                Vector3 pmid = Vector3.Transform(pstart, matrix);
                if (pmid != pend)
                {
                    Vector3 axis = Vector3.Cross(pmid, pend);
                    axis.Normalize();

                    System.Windows.Media.Media3D.Vector3D v1 = new System.Windows.Media.Media3D.Vector3D(pmid.X, pmid.Y, pmid.Z);
                    System.Windows.Media.Media3D.Vector3D v2 = new System.Windows.Media.Media3D.Vector3D(pend.X, pend.Y, pend.Z);
                    float angle = (float)(System.Windows.Media.Media3D.Vector3D.AngleBetween(v1, v2) / 180.0 * Math.PI);
                    matrix *= Matrix.CreateFromAxisAngle(axis, angle);
                }
            }
            else
            {
                matrix = Matrix.CreateTranslation(pend - pstart);
            }
            return(matrix);
        }
コード例 #7
0
        public System.Windows.Media.Media3D.Matrix3D update(System.Windows.Media.Media3D.Matrix3D current_needle_mid_move_head)
        {
            /*
             * Quaternion q;
             * q = Quaternion.Slerp(q1, q2, t);
             * t = t + .1; // need a point to stop
             * Matrix44 m = Matrix44.CreateFromQuaternion(q);
             * Vector3 trans=Vector3.Lerp()
             * return matrix44to3D(m);
             * */
            //Matrix44 m = Matrix44.Lerp(m1, m2, t);

            Matrix44 m = matrix3Dto44(current_needle_mid_move_head);

            System.Windows.Media.Media3D.Vector3D v = bezierInterpolation.bezier(t);
            m.R0C3 = v.X;
            m.R1C3 = v.Y;
            m.R2C3 = v.Z;
            t      = t + 0.1; // need a point to stop
            if (t > 1)
            {
                t = 1;
            }
            return(matrix44to3D(m));
        }
        private static async Task <MapPoint> CreatePointAlongArc(MapPoint startPt, MapPoint endPt, MapPoint centerPt, double angle, double radius, SpatialReference spatRef, bool arcIsMinor, bool arcIsCounterClockwise)
        {
            System.Windows.Media.Media3D.Vector3D start = new System.Windows.Media.Media3D.Vector3D(startPt.X - centerPt.X, startPt.Y - centerPt.Y, startPt.Z - centerPt.Z);
            System.Windows.Media.Media3D.Vector3D end   = new System.Windows.Media.Media3D.Vector3D(endPt.X - centerPt.X, endPt.Y - centerPt.Y, endPt.Z - centerPt.Z);

            System.Windows.Media.Media3D.Vector3D normalOfPlane = new System.Windows.Media.Media3D.Vector3D();
            normalOfPlane = System.Windows.Media.Media3D.Vector3D.CrossProduct(start, end);

            //Two ortho vectors: orthoVec and start
            System.Windows.Media.Media3D.Vector3D orthoVec = new System.Windows.Media.Media3D.Vector3D();
            orthoVec = System.Windows.Media.Media3D.Vector3D.CrossProduct(normalOfPlane, start);

            //If this is not done then half of the keyframes for S-shaped curve are not on the curve
            if (arcIsMinor && !arcIsCounterClockwise)
            {
                orthoVec.Negate();
            }

            //Normalize
            start.Normalize();
            orthoVec.Normalize();

            System.Windows.Media.Media3D.Vector3D ptAlong = new System.Windows.Media.Media3D.Vector3D();
            ptAlong = radius * Math.Cos(angle) * start + radius * Math.Sin(angle) * orthoVec;

            MapPoint intermediateKeyframePoint = await QueuedTask.Run(() => MapPointBuilder.CreateMapPoint(ptAlong.X + centerPt.X, ptAlong.Y + centerPt.Y, ptAlong.Z + centerPt.Z, spatRef));

            return(intermediateKeyframePoint);
        }
コード例 #9
0
ファイル: FFXI_Interface.cs プロジェクト: incognel/ffxiai
        public System.Windows.Media.Media3D.Vector3D GetPOS()
        {
            System.Windows.Media.Media3D.Vector3D v = new System.Windows.Media.Media3D.Vector3D();
            v.X = _FFACE.Player.PosX;
            v.Y = _FFACE.Player.PosY;
            v.Z = _FFACE.Player.PosZ;

            return(v);
        }
コード例 #10
0
        public static Geometry3D GetToolModel(Tool tool, Point3D position, Vector3D direction)
        {
            Geometry3D model = null;

            switch (tool.ToolType)
            {
            case global::Tools.Models.Enums.ToolType.None:
                break;

            case global::Tools.Models.Enums.ToolType.Base:
                break;

            case global::Tools.Models.Enums.ToolType.Simple:
                model = GetSimpleModel(tool, position, direction);
                break;

            case global::Tools.Models.Enums.ToolType.TwoSection:
                model = GetTwoSectionModel(tool, position, direction);
                break;

            case global::Tools.Models.Enums.ToolType.Pointed:
                model = GetPointedModel(tool, position, direction);
                break;

            case global::Tools.Models.Enums.ToolType.Disk:
                model = GetDiskModel(tool, position, direction);
                break;

            case global::Tools.Models.Enums.ToolType.BullNoseConcave:
                break;

            case global::Tools.Models.Enums.ToolType.BullNoseConvex:
                break;

            case global::Tools.Models.Enums.ToolType.Composed:
                break;

            case global::Tools.Models.Enums.ToolType.Countersink:
                model = GetCountersinkModel(tool, position, direction);
                break;

            case global::Tools.Models.Enums.ToolType.DiskOnCone:
                model = GetDiskOnConeModel(tool, position, direction);
                break;

            default:
                break;
            }

            if (model == null)
            {
                throw new NotImplementedException();
            }

            return(model);
        }
コード例 #11
0
ファイル: XMLHandler.cs プロジェクト: saras152/covise
        /// <summary>
        /// Update settings.
        /// </summary>
        /// <param name="doc">Xml document.</param>
        /// <param name="keyPath">Path to attribute in SimulationDefault in Settings.</param>
        /// <param name="entryName">Name of node in settings.</param>
        /// <param name="entryValue">Value in settings.</param>
        private void UpdateSettingsBasedOnXmlEntry(XmlDocument doc, List <string> keyPath, string entryName, object entryValue)
        {
            keyPath.Add(entryName);
            string  xmlPath = GetXmlPath(keyPath);
            XmlNode node    = doc.SelectSingleNode(xmlPath);
            object  value   = null;

            if (entryValue is double)
            {
                value = Convert.ToDouble(node.FirstChild.Value, System.Globalization.CultureInfo.GetCultureInfo("en-US"));
            }
            else if (entryValue is int)
            {
                value = Convert.ToInt32(node.FirstChild.Value);
            }
            else if (entryValue is System.Windows.Media.Media3D.Vector3D)
            {
                List <double> vec = new List <double>();
                foreach (var vecEntry in node.FirstChild.Value.Split(';'))
                {
                    vec.Add(Convert.ToDouble(vecEntry, System.Globalization.CultureInfo.GetCultureInfo("en-US")));
                }
                value = new System.Windows.Media.Media3D.Vector3D(vec[0], vec[1], vec[2]);
            }
            else if (entryValue is System.Windows.Vector)
            {
                List <double> vec = new List <double>();
                foreach (var vecEntry in node.FirstChild.Value.Split(';'))
                {
                    vec.Add(Convert.ToDouble(vecEntry, System.Globalization.CultureInfo.GetCultureInfo("en-US")));
                }
                value = new System.Windows.Vector(vec[0], vec[1]);
            }
            else if (entryValue is bool)
            {
                value = Convert.ToBoolean(node.FirstChild.Value);
            }
            else if (entryValue is Enum e)
            {
                foreach (var enu in Enum.GetValues(e.GetType()))
                {
                    if (node.FirstChild.Value.Equals(enu))
                    {
                        value = enu;
                    }
                }
            }
            else if (entryValue is string s)
            {
                value = node.FirstChild.Value;
            }
            if (value != null)
            {
                m_Settings.UpdateSettingsEntry(keyPath, value);
            }
        }
コード例 #12
0
        /// <summary>
        /// Changes the direction.
        /// </summary>
        /// <param name="lookDir">The look dir.</param>
        /// <param name="upDir">Up dir.</param>
        /// <param name="animationTime">The animation time.</param>
        public void ChangeDirection(System.Windows.Media.Media3D.Vector3D lookDir, System.Windows.Media.Media3D.Vector3D upDir, double animationTime = 500)
        {
            if (!this.IsRotationEnabled)
            {
                return;
            }

            this.StopAnimations();
            this.PushCameraSetting();
            this.ActualCamera.ChangeDirection(lookDir, upDir, animationTime);
        }
コード例 #13
0
        /// <summary>
        /// Un-projects a point from the screen (2D) to a point on plane (3D)
        /// </summary>
        /// <param name="p">
        /// The 2D point.
        /// </param>
        /// <param name="position">
        /// plane position
        /// </param>
        /// <param name="normal">
        /// plane normal
        /// </param>
        /// <returns>
        /// A 3D point.
        /// </returns>
        public Point3D?UnProject(Point p, Point3D position, Vector3D normal)
        {
            var ray = this.GetRay(p);

            if (ray == null)
            {
                return(null);
            }

            return(ray.PlaneIntersection(position, normal));
        }
コード例 #14
0
        public static ToolViewModel Create(Tool tool, Point3D position, Vector3D direction)
        {
            var vm = new ToolViewModel();

            vm.Name        = tool.Name;
            vm.Material    = PhongMaterials.Blue;
            vm.Geometry    = ToolsHelpers.GetToolModel(tool, position, direction);
            vm.Visible     = true;
            vm.PostEffects = "xrayGrid[color:#D22FDCDC]";

            return(vm);
        }
コード例 #15
0
        private static Geometry3D GetSimpleModel(Tool tool, Point3D position, Vector3D direction)
        {
            var t       = tool as SimpleTool;
            var builder = new MeshBuilder();
            var p       = position + direction * t.Length;

            builder.AddCylinder(position.ToVector3(),
                                p.ToVector3(),
                                t.Diameter / 2.0);

            return(builder.ToMesh());
        }
コード例 #16
0
        public System.Windows.Media.Media3D.Vector3D interpolate_center(Needle needle_entry, Needle needle_exit)
        {
            Vector3 v1 = new Vector3(needle_entry.center.M14, needle_entry.center.M24, needle_entry.center.M34);
            Vector3 v2 = new Vector3(needle_exit.center.M14, needle_exit.center.M24, needle_exit.center.M34);

            Vector3 v_mid = Vector3.Lerp(v1, v2, t);
            t = t + .1;
            if (t > 1)
                t = 1;
            System.Windows.Media.Media3D.Vector3D output = new System.Windows.Media.Media3D.Vector3D(v_mid.X, v_mid.Y, v_mid.Z);
            return output;
        }
コード例 #17
0
        private IMachineElementViewModel CreateInsertElement(Point3D position, Vector3D direction)
        {
            var builder = new MeshBuilder();

            builder.AddCylinder(position.ToVector3(),
                                (position + direction * Length).ToVector3(),
                                Diameter / 2.0);
            return(new InserterObjectViewModel()
            {
                Geometry = builder.ToMesh(), Material = Material, Visible = true
            });
        }
コード例 #18
0
        /// <summary>
        /// Pans the camera by the specified 3D vector (world coordinates).
        /// </summary>
        /// <param name="delta">
        /// The panning vector.
        /// </param>
        public void Pan(Vector3D delta)
        {
            if (!this.Controller.IsPanEnabled)
            {
                return;
            }

            if (this.CameraMode == CameraMode.FixedPosition)
            {
                return;
            }

            this.Camera.Position += delta;
        }
コード例 #19
0
ファイル: PanHandler.cs プロジェクト: BEEden/Diplomarbeit
        /// <summary>
        /// Pans the camera by the specified 3D vector (world coordinates).
        /// </summary>
        /// <param name="delta">
        /// The panning vector.
        /// </param>
        public void Pan(Vector3D delta)
        {
            if (!this.Viewport.IsPanEnabled)
            {
                return;
            }

            if (this.CameraMode == CameraMode.FixedPosition)
            {
                return;
            }

            this.Camera.Position += delta;
        }
コード例 #20
0
        private IMachineElementViewModel CreateInjectElement(Point3D position, Vector3D direction)
        {
            var builder = new HelixToolkit.Wpf.SharpDX.MeshBuilder();

            builder.AddCone((position + direction * 20.0).ToVector3(),
                            position.ToVector3(),
                            4.0,
                            true,
                            20);
            return(new InserterObjectViewModel()
            {
                Geometry = builder.ToMesh(), Material = Material, Visible = true
            });
        }
コード例 #21
0
        public System.Windows.Media.Media3D.Vector3D interpolate_center(Needle needle_entry, Needle needle_exit)
        {
            Vector3 v1 = new Vector3(needle_entry.center.M14, needle_entry.center.M24, needle_entry.center.M34);
            Vector3 v2 = new Vector3(needle_exit.center.M14, needle_exit.center.M24, needle_exit.center.M34);

            Vector3 v_mid = Vector3.Lerp(v1, v2, t);

            t = t + .1;
            if (t > 1)
            {
                t = 1;
            }
            System.Windows.Media.Media3D.Vector3D output = new System.Windows.Media.Media3D.Vector3D(v_mid.X, v_mid.Y, v_mid.Z);
            return(output);
        }
コード例 #22
0
        private static Geometry3D GetTwoSectionModel(Tool tool, Point3D position, Vector3D direction)
        {
            var t       = tool as TwoSectionTool;
            var builder = new MeshBuilder();
            var p1      = position + direction * t.Length1;
            var p2      = position + direction * (t.Length1 + t.Length2);

            builder.AddCylinder(position.ToVector3(),
                                p1.ToVector3(),
                                t.Diameter1 / 2.0);
            builder.AddCylinder(p1.ToVector3(),
                                p2.ToVector3(),
                                t.Diameter2 / 2.0);

            return(builder.ToMesh());
        }
        private static async Task <MapPoint> CreatePointAlongSegment(MapPoint startPt, MapPoint endPt, double distanceFromStartPoint, SpatialReference spatRef)
        {
            System.Windows.Media.Media3D.Point3D  fromPt  = new System.Windows.Media.Media3D.Point3D(startPt.X, startPt.Y, startPt.Z);
            System.Windows.Media.Media3D.Point3D  toPt    = new System.Windows.Media.Media3D.Point3D(endPt.X, endPt.Y, endPt.Z);
            System.Windows.Media.Media3D.Vector3D lineVec = new System.Windows.Media.Media3D.Vector3D(toPt.X - fromPt.X, toPt.Y - fromPt.Y, toPt.Z - fromPt.Z);

            lineVec.Normalize();

            System.Windows.Media.Media3D.Point3D ptAlong = new System.Windows.Media.Media3D.Point3D(fromPt.X + distanceFromStartPoint * (lineVec.X),
                                                                                                    fromPt.Y + distanceFromStartPoint * (lineVec.Y),
                                                                                                    fromPt.Z + distanceFromStartPoint * (lineVec.Z));

            MapPoint intermediateKeyframePoint = await QueuedTask.Run(() => MapPointBuilder.CreateMapPoint(ptAlong.X, ptAlong.Y, ptAlong.Z, spatRef));

            return(intermediateKeyframePoint);
        }
コード例 #24
0
        internal protected override bool TestPosture(Microsoft.Kinect.Skeleton s)
        {
            var handRight = s.Joints[Microsoft.Kinect.JointType.HandRight];
            var hipLeft   = s.Joints[Microsoft.Kinect.JointType.HipLeft];

            if (handRight.TrackingState != Microsoft.Kinect.JointTrackingState.Tracked || hipLeft.TrackingState != Microsoft.Kinect.JointTrackingState.Tracked)
            {
                return(false);
            }
            var handRightPosition = handRight.Position;
            var hipLeftPosition   = hipLeft.Position;

            System.Windows.Media.Media3D.Vector3D vector = new System.Windows.Media.Media3D.Vector3D(handRightPosition.X - hipLeftPosition.X,
                                                                                                     handRightPosition.Y - hipLeftPosition.Y,
                                                                                                     handRightPosition.Z - hipLeftPosition.Z);
            return(vector.Length < 0.2);
        }
コード例 #25
0
        private static Geometry3D GetPointedModel(Tool tool, Point3D position, Vector3D direction)
        {
            var t       = tool as PointedTool;
            var builder = new MeshBuilder();
            var p1      = position + direction * t.StraightLength;
            var p2      = position + direction * (t.StraightLength + t.ConeHeight);

            builder.AddCylinder(position.ToVector3(),
                                p1.ToVector3(),
                                t.Diameter / 2.0);
            builder.AddCone(p1.ToVector3(),
                            p2.ToVector3(),
                            t.Diameter / 2.0,
                            false,
                            20);

            return(builder.ToMesh());
        }
コード例 #26
0
        public static ToolWithConeViewModel Create(Tool tool, Point3D position, Vector3D direction)
        {
            var vm  = new ToolWithConeViewModel();
            var tvm = ToolViewModel.Create(tool, new Point3D(), direction);

            vm.Name      = $"{tool.Name}(cone)";
            vm.Material  = PhongMaterials.PolishedSilver;
            vm.Geometry  = ToolsHelpers.GetConeModel(tool.ConeModelFile);
            vm.Transform = new TranslateTransform3D()
            {
                OffsetX = position.X, OffsetY = position.Y, OffsetZ = position.Z
            };
            vm.Visible = true;
            vm.Children.Add(tvm);
            tvm.Parent = vm;

            return(vm);
        }
コード例 #27
0
ファイル: STimCameraNode.cs プロジェクト: hcilab-um/STim
        //called when data for any output pin is requested
        public void Evaluate(int SpreadMax)
        {
            FOutViewMatrix.SliceCount = SpreadMax;
            System.Windows.Media.Media3D.Vector3D cameraPosition = new System.Windows.Media.Media3D.Vector3D();
            cameraPosition.X = FInCameraPosition[0].x;
            cameraPosition.Y = FInCameraPosition[0].y;
            cameraPosition.Z = FInCameraPosition[0].z;

            FOutViewMatrix[0] = Math3D.SetViewMatrix(cameraPosition, LOOK_DIR, UP_DIR);

            double zn = 0.01;
            double zf = 100;
            double left = zn * (-FInDisplayWidthInMeters[0] / 2 - cameraPosition.X) / cameraPosition.Z;
            double right = zn * (FInDisplayWidthInMeters[0] / 2 - cameraPosition.X) / cameraPosition.Z;
            double bottom = zn * (-FInDisplayHeightInMeters[0] / 2 - cameraPosition.Y) / cameraPosition.Z;
            double top = zn * (FInDisplayHeightInMeters[0] / 2 - cameraPosition.Y) / cameraPosition.Z;

            FOutProjectionMatrix[0] = Math3D.SetPerspectiveOffCenter(left, right, bottom, top, zn, zf);
        }
コード例 #28
0
ファイル: MainViewModel.cs プロジェクト: BEEden/Diplomarbeit
        private Transform3D CreateAnimatedTransform(Vector3D translate, Vector3D axis, double speed = 4)
        {
            var animationTrafo = new Transform3DGroup();
            animationTrafo.Children.Add(new TranslateTransform3D(translate));

            var rotateAnimation = new Rotation3DAnimation
            {
                RepeatBehavior = RepeatBehavior.Forever,
                By = new AxisAngleRotation3D(axis, 90),
                Duration = TimeSpan.FromSeconds(speed / 4),
                IsCumulative = true,
            };

            var rotateTransform = new RotateTransform3D();
            rotateTransform.BeginAnimation(RotateTransform3D.RotationProperty, rotateAnimation);
            animationTrafo.Children.Add(rotateTransform);

            return animationTrafo;
        }
コード例 #29
0
ファイル: Camera.cs プロジェクト: wangdi190/DNV863
        /// <summary>
        /// 自动调整相机距离以显示指定范围
        /// </summary>
        public void adjustCameraRange(System.Windows.Rect rect)
        {
            double minjd, maxjd, minwd, maxwd;

            minwd = rect.Left; maxwd = rect.Right; minjd = rect.Top; maxjd = rect.Bottom;
            List <VECTOR3D> corners = new List <VECTOR3D>();
            VECTOR3D        lefttop, righttop, leftbottom, rightbottom, center;

            System.Windows.Media.Media3D.Vector3D lt, rt, lb, rb;
            lefttop     = MapHelper.JWHToPoint(minjd, maxwd, 0, earth.earthManager.earthpara); corners.Add(lefttop); lt = Helpler.vecD3DToWpf(lefttop);
            righttop    = MapHelper.JWHToPoint(maxjd, maxwd, 0, earth.earthManager.earthpara); corners.Add(righttop); rt = Helpler.vecD3DToWpf(righttop);
            leftbottom  = MapHelper.JWHToPoint(minjd, minwd, 0, earth.earthManager.earthpara); corners.Add(leftbottom); lb = Helpler.vecD3DToWpf(leftbottom);
            rightbottom = MapHelper.JWHToPoint(maxjd, minwd, 0, earth.earthManager.earthpara); corners.Add(rightbottom); rb = Helpler.vecD3DToWpf(rightbottom);
            System.Windows.Media.Media3D.Vector3D cent = new System.Windows.Media.Media3D.Vector3D((corners.Max(p => p.x) + corners.Min(p => p.x)) / 2, (corners.Max(p => p.y) + corners.Min(p => p.y)) / 2, (corners.Max(p => p.z) + corners.Min(p => p.z)) / 2);
            if (earth.earthManager.earthpara.SceneMode == ESceneMode.地球)
            {
                cent   = cent * Para.Radius / cent.Length;
                center = new VECTOR3D(cent.X, cent.Y, cent.Z);
            }
            else  //zh注:还未验证
            {
                center = new VECTOR3D(cent.X, cent.Y, 0);
            }
            double width, height;

            width  = Math.Max((rt - lt).Length, (rb - lb).Length) * 1.5;
            height = Math.Max((lb - lt).Length, (rb - rt).Length) * 1.5;
            double distance;

            if (width / height > earth.global.ScreenWidth / earth.global.ScreenHeight) //以宽度来计算
            {
                distance = width * earth.global.ScreenHeight / earth.global.ScreenWidth / 2 / Math.Atan(FieldOfView / 2);
            }
            else //以高度来计算
            {
                distance = height / 2 / Math.Atan(FieldOfView / 2);
            }

            aniLook(center);
            adjustCameraDistance((float)distance);
        }
コード例 #30
0
        private Transform3D CreateAnimatedTransform(Vector3D translate, Vector3D axis, double speed = 4)
        {
            var animationTrafo = new Transform3DGroup();

            animationTrafo.Children.Add(new TranslateTransform3D(translate));

            var rotateAnimation = new Rotation3DAnimation
            {
                RepeatBehavior = RepeatBehavior.Forever,
                By             = new AxisAngleRotation3D(axis, 90),
                Duration       = TimeSpan.FromSeconds(speed / 4),
                IsCumulative   = true,
            };

            var rotateTransform = new RotateTransform3D();

            rotateTransform.BeginAnimation(RotateTransform3D.RotationProperty, rotateAnimation);
            animationTrafo.Children.Add(rotateTransform);

            return(animationTrafo);
        }
コード例 #31
0
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     vector3D = (System.Windows.Media.Media3D.Vector3D)value;
     try
     {
         if (parameter.ToString() == "X")
         {
             return(vector3D.X.ToString("F3", CultureInfo.InvariantCulture));
         }
         else if (parameter.ToString() == "Y")
         {
             return(vector3D.Y.ToString("F3", CultureInfo.InvariantCulture));
         }
         else if (parameter.ToString() == "Z")
         {
             return(vector3D.Z.ToString("F3", CultureInfo.InvariantCulture));
         }
     }
     catch { }
     return(value);
 }
コード例 #32
0
ファイル: Program.cs プロジェクト: MelakuSeyoum/KarambaIDEA
        static void Main()
        {
            VectorRAZ a = new VectorRAZ(1, 2, 3);
            VectorRAZ b = new VectorRAZ(0, 0, 1);

            double angle = 90.0;

            double    scalar = VectorRAZ.DotProduct(a, b);
            VectorRAZ vector = VectorRAZ.CrossProduct(a, b);
            VectorRAZ xx     = VectorRAZ.RotateVector(b, angle, a);

            System.Windows.Media.Media3D.Vector3D va = new System.Windows.Media.Media3D.Vector3D(a.X, a.Y, a.Z);
            System.Windows.Media.Media3D.Vector3D vb = new System.Windows.Media.Media3D.Vector3D(b.X, b.Y, b.Z);

            double dot = System.Windows.Media.Media3D.Vector3D.DotProduct(va, vb);

            System.Windows.Media.Media3D.Vector3D cross = System.Windows.Media.Media3D.Vector3D.CrossProduct(va, vb);

            System.Windows.Media.Media3D.AxisAngleRotation3D vec = new System.Windows.Media.Media3D.AxisAngleRotation3D();



            //System.Windows.Media.Media3D.Rotation3D rot = new System.Windows.Media.Media3D.Rotation3D();


            KarambaIDEA.MainWindow   mainWindow = new MainWindow();
            Tester.GenerateTestJoint fj         = new GenerateTestJoint();
            //KarambaIDEA.TestFrameworkJoint fj = new TestFrameworkJoint();

            //hieronder testjoint definieren
            Joint joint = fj.Testjoint();

            //Joint joint = fj.Testjoint5();
            joint.project.CreateFolder(@"C:\Data\");
            joint.project.templatePath = @"C:\Data\template.contemp";
            //min lasafmeting uitzetten bij Grasshopper
            joint.project.minthroat = 1.0;

            mainWindow.Test(joint);
        }
コード例 #33
0
            //---------------------------------------------------------------------------------------------------------
            /// <summary>
            /// Конвертация объекта вектор в объект типа <see cref="Vector3D"/>
            /// </summary>
            /// <param name="value">Значение</param>
            /// <param name="target_type">Целевой тип</param>
            /// <param name="parameter">Дополнительный параметр</param>
            /// <param name="culture">Культура</param>
            /// <returns>Объект <see cref="Vector3D"/></returns>
            //---------------------------------------------------------------------------------------------------------
            public Object Convert(Object value, Type target_type, Object parameter, CultureInfo culture)
            {
                if (value is Vector3D)
                {
                    return(value);
                }

                if (value is System.Windows.Media.Media3D.Vector3D)
                {
                    System.Windows.Media.Media3D.Vector3D v = (System.Windows.Media.Media3D.Vector3D)value;
                    return(new Vector3D(v.X, v.Y, v.Z));
                }

                if (value is System.Windows.Media.Media3D.Point3D)
                {
                    System.Windows.Media.Media3D.Point3D v = (System.Windows.Media.Media3D.Point3D)value;
                    return(new Vector3D(v.X, v.Y, v.Z));
                }

#if USE_ASSIMP
                if (value is Assimp.Vector3D)
                {
                    Assimp.Vector3D v = (Assimp.Vector3D)value;
                    return(new Vector3D(v.X, v.Y, v.Z));
                }
#endif

#if USE_SHARPDX
                if (value is SharpDX.Vector3)
                {
                    SharpDX.Vector3 v = (SharpDX.Vector3)value;
                    return(new Vector3D(v.X, v.Y, v.Z));
                }
#endif
                return(Vector3D.Zero);
            }
コード例 #34
0
 public System.Windows.Media.Media3D.Vector3D GetCurrentValue(System.Windows.Media.Media3D.Vector3D defaultOriginValue, System.Windows.Media.Media3D.Vector3D defaultDestinationValue, AnimationClock animationClock)
 {
     return(default(System.Windows.Media.Media3D.Vector3D));
 }
コード例 #35
0
 protected abstract System.Windows.Media.Media3D.Vector3D GetCurrentValueCore(System.Windows.Media.Media3D.Vector3D defaultOriginValue, System.Windows.Media.Media3D.Vector3D defaultDestinationValue, AnimationClock animationClock);
コード例 #36
0
 public ArmEffortEstimator()
 {
   displacement = new System.Windows.Media.Media3D.Vector3D();
   measuredAcceleration = new System.Windows.Media.Media3D.Vector3D();
   currentVelocity = new System.Windows.Media.Media3D.Vector3D(0, 0, 0);
 }
コード例 #37
0
ファイル: FFXI_Interface.cs プロジェクト: framerate/ffxiai
        public System.Windows.Media.Media3D.Vector3D GetPOS()
        {
            System.Windows.Media.Media3D.Vector3D v = new System.Windows.Media.Media3D.Vector3D();
            v.X = _FFACE.Player.PosX;
            v.Y = _FFACE.Player.PosY;
            v.Z = _FFACE.Player.PosZ;

            return v;
        }
コード例 #38
0
    public void EstimateEffort(Skeleton skeleton, double delta, double totalTime)
    {

      armJointPoints = GetArmPoints(skeleton);
      elbowAngleSum += ToolBox.CalculateAngle((System.Windows.Media.Media3D.Vector3D)armJointPoints[Elbow], GRAVITY_VECTOR);
      wristAngleSum += ToolBox.CalculateAngle((System.Windows.Media.Media3D.Vector3D)armJointPoints[Hand], GRAVITY_VECTOR);

      //total arm mass center
      CenterOfMass = CalculateCenterMass(armJointPoints[Shoulder], armJointPoints[Elbow], armJointPoints[Hand]);

      //angel of shoulder-centermass vector with gravity acceleration
      Theta = Math.PI * ToolBox.CalculateAngle(armCM, GRAVITY_VECTOR) / 180;
      //4- Calculate movement acceleration
      displacement = ToolBox.CalculateDisplacement(armLastCM, armCM);
      //v
      currentVelocity = CalculateVelocity(displacement, delta);
      //a
      measuredAcceleration = CalculateMovingAcc(currentVelocity, lastVelocity, delta);
      //α
      angularAcc = CalculateAngularAcc(measuredAcceleration, CenterOfMass.Length);
      //Iα/m
      inertialTorqueWithoutMass = CalculateMaxInertialTorqueWithoutMass();

      //AmMxR= GMxR + Iα + FhxR  --- (measured_acceleration times arm_mass) cross radius = (gravity_acceleration times arm_mass) cross radius + arm_inertia times angular_acceleration + human_force cross radius
      //FhxR = AmMxR - (GMxR + Iα)
      System.Windows.Media.Media3D.Vector3D amM = measuredAcceleration * armMass;
      System.Windows.Media.Media3D.Vector3D amMxR = System.Windows.Media.Media3D.Vector3D.CrossProduct(amM, CenterOfMass);
      System.Windows.Media.Media3D.Vector3D gM = GRAVITY_VECTOR * armMass;
      System.Windows.Media.Media3D.Vector3D gMxR = System.Windows.Media.Media3D.Vector3D.CrossProduct(gM, CenterOfMass);
      System.Windows.Media.Media3D.Vector3D fhxR = amMxR - (gMxR + inertialTorque);

      HumanTorque = fhxR.Length;
      MaxHumanTorquePercent = HumanTorque / maxTorque * 100;
      if (MaxHumanTorquePercent - 15 <= 0)
        TbEndurance = MAX_ENDURANCE;
      else
        TbEndurance = 1236.5 / Math.Pow((MaxHumanTorquePercent - 15), 0.618) - 72.5;

      HumanTorqueSum += fhxR.Length * delta;
      MeasuredTorqueSum += amMxR.Length * delta;
      GravityTorqueSum += gMxR.Length * delta;
      InertialTorqueSum += inertialTorque.Length * delta;

      AvgHumanTorque = HumanTorqueSum / totalTime;
      MaxAvgHumanTorquePercent = AvgHumanTorque / maxTorque * 100;
      if (MaxAvgHumanTorquePercent - 15 <= 0)
        AvgTbEndurance = MAX_ENDURANCE;
      else
        AvgTbEndurance = 1236.5 / Math.Pow((MaxAvgHumanTorquePercent - 15), 0.618) - 72.5;

      TbEnduranceLostPercent = 100 * totalTime / AvgTbEndurance;
      TbEnduranceLostRate = TbEnduranceLostPercent / totalTime;

      //AmMxR= GMxR + Iα + FhxR  --- (measured_acceleration times arm_mass) cross radius = (gravity_acceleration times arm_mass) cross radius + arm_inertia times angular_acceleration + human_force cross radius
      //FhxR = AmMxR - (GMxR + Iα)
      //FhxR/M = AmMxR/M - (GMxR/M + Iα/M) --- as Fh = Ah * M
      //AhxR = AmxR - (GxR + Iα/M)
      System.Windows.Media.Media3D.Vector3D measuredAcceletarionCrossRadius = System.Windows.Media.Media3D.Vector3D.CrossProduct(measuredAcceleration, CenterOfMass);
      System.Windows.Media.Media3D.Vector3D gravityCrossRadius = System.Windows.Media.Media3D.Vector3D.CrossProduct(GRAVITY_VECTOR, CenterOfMass);
      System.Windows.Media.Media3D.Vector3D midTerm = ToolBox.VectorAddition(gravityCrossRadius, inertialTorqueWithoutMass);
      System.Windows.Media.Media3D.Vector3D humanAccelerationCrossRadius = ToolBox.VectorAddition(measuredAcceletarionCrossRadius, -midTerm);
      CoMMeasuredAcc = measuredAcceleration.Length;
      CoMHumanAcc = humanAccelerationCrossRadius.Length / CenterOfMass.Length;
      CoMHumanForce = CoMHumanAcc * armMass;
      MaxCoMHumanForcePercent = CoMHumanForce / maxForce * 100;
      if (MaxCoMHumanForcePercent - 15 <= 0)
        FbEndurance = MAX_ENDURANCE;
      else
        FbEndurance = 1236.5 / Math.Pow((MaxCoMHumanForcePercent - 15), 0.618) - 72.5;

      CoMHumanAccSum += comHumanAcc * delta;
      CoMHumanForceSum += comHumanForce * delta;
      AvgCoMHumanForce = CoMHumanForceSum / totalTime;
      MaxAvgCoMHumanForcePercent = AvgCoMHumanForce / maxForce *100;
      if (MaxAvgCoMHumanForcePercent - 15 <= 0)
        AvgFbEndurance = MAX_ENDURANCE;
      else
        AvgFbEndurance = 1236.5 / Math.Pow((MaxAvgCoMHumanForcePercent - 15), 0.618) - 72.5;

      FbEnduranceLostPercent = 100 * totalTime / AvgFbEndurance;
      FbEnduranceLostRate = FbEnduranceLostPercent / totalTime;

      //shift center of mass value
      upperLastCM = upperCM;
      foreLastCM = foreCM;
      armLastCM = armCM;
      lastTheta = theta;
      lastVelocity = currentVelocity;
    }
コード例 #39
0
        /// <summary>
        /// Un-projects a point from the screen (2D) to a point on plane (3D)
        /// </summary>
        /// <param name="p">
        /// The 2D point.
        /// </param>
        /// <param name="position">
        /// plane position
        /// </param>
        /// <param name="normal">
        /// plane normal
        /// </param>
        /// <returns>
        /// A 3D point.
        /// </returns>
        public Point3D? UnProject(Point p, Point3D position, Vector3D normal)
        {
            var ray = this.GetRay(p);
            if (ray == null)
            {
                return null;
            }

            return ray.PlaneIntersection(position, normal);
        }
コード例 #40
0
 private System.Windows.Media.Media3D.Vector3D CalculateVelocity(System.Windows.Media.Media3D.Vector3D disp, double delta)
 {
   System.Windows.Media.Media3D.Vector3D velocity = new System.Windows.Media.Media3D.Vector3D();
   //calculate velocity
   //4.1- Calculate new velocity
   if (delta != 0)
   {
     velocity.X = disp.X / delta;
     velocity.Y = disp.Y / delta;
     velocity.Z = disp.Z / delta;
   }
   return velocity;
 }
コード例 #41
0
 private System.Windows.Media.Media3D.Vector3D CalculateMovingAcc(System.Windows.Media.Media3D.Vector3D currentV,
   System.Windows.Media.Media3D.Vector3D lastV, double delta)
 {
   System.Windows.Media.Media3D.Vector3D acceleration = new System.Windows.Media.Media3D.Vector3D();
   //calculate velocity and acceleration vector
   //4.2- Calculate new acceleration
   if (delta != 0)
   {
     acceleration.X = (currentV.X - lastV.X) / delta;
     acceleration.Y = (currentV.Y - lastV.Y) / delta;
     acceleration.Z = (currentV.Z - lastV.Z) / delta;
   }
   return acceleration;
 }
コード例 #42
0
    public System.Windows.Media.Media3D.Vector3D CalculateMaxInertialTorqueWithoutMass()
    {
      inertialTorque =System.Windows.Media.Media3D.Vector3D.CrossProduct(displacement, armCM);
      if (inertialTorque.Length!=0)
        inertialTorque.Normalize();
      inertialTorque.X *= (UPPER_ARM_INERTIA_RATE+FORE_ARM_INERTIA_RATE)*angularAcc;
      inertialTorque.Y *= (UPPER_ARM_INERTIA_RATE + FORE_ARM_INERTIA_RATE) * angularAcc;
      inertialTorque.Z *= (UPPER_ARM_INERTIA_RATE + FORE_ARM_INERTIA_RATE) * angularAcc;

      inertialTorqueWithoutMass.X = inertialTorque.X / armMass;
      inertialTorqueWithoutMass.Y = inertialTorque.Y / armMass;
      inertialTorqueWithoutMass.Z = inertialTorque.Z / armMass;
      return inertialTorqueWithoutMass;
    }