Esempio n. 1
0
        public TabControlPartsVM_CreateNew(EditorColors colors, IEnumerable <PartToolItemBase> parts)
            : base(colors)
        {
            _parts = parts.ToArray();

            BuildToolBox(_parts);
        }
        //NOTE: Radius isn't the radius of the ball, it's how far that ball is from the center
        public DraggableModifierSphere(Vector3D offset, EditorColors editorColors)
            : base(editorColors)
        {
            _radius = offset.Length;
            _initialOffset = offset.ToUnit();

            this.Model = new ModelVisual3D();
            this.Model.Content = GetBall();
        }
Esempio n. 3
0
        //NOTE: Radius isn't the radius of the ball, it's how far that ball is from the center
        public DraggableModifierSphere(Vector3D offset, EditorColors editorColors)
            : base(editorColors)
        {
            _radius        = offset.Length;
            _initialOffset = offset.ToUnit();

            this.Model         = new ModelVisual3D();
            this.Model.Content = GetBall();
        }
Esempio n. 4
0
        public LayerRow(EditorColors colors)
        {
            InitializeComponent();

            _colors = colors;

            // The textbox's cursor can't be set directly, but is the opposite of background.  If I just use null or transparent, the cursor is still
            // black, so I'm making the background transparent black, which makes the cursor white;
            //txtName.Background = new SolidColorBrush(Color.FromArgb(0, 0, 0, 0));
            txtName.Background = new SolidColorBrush(Color.FromArgb(0, colors.Background.R, colors.Background.G, colors.Background.B));

            txtName.Foreground = new SolidColorBrush(colors.PartVisual_TextColor);
        }
Esempio n. 5
0
        public TabControlPartsVM_FixedSupply(EditorColors colors, IEnumerable <PartDesignBase> parts)
            : base(colors)
        {
            _brushPrimary   = new SolidColorBrush(_colors.TabIcon_Primary);
            _brushSecondary = new SolidColorBrush(_colors.TabIcon_Secondary);

            _tabParts.CollectionChanged += TabParts_CollectionChanged;

            foreach (PartDesignBase part in parts)
            {
                AddToTab(part);
            }
        }
Esempio n. 6
0
        public LayerRow(EditorColors colors)
        {
            InitializeComponent();

            _colors = colors;

            // The textbox's cursor can't be set directly, but is the opposite of background.  If I just use null or transparent, the cursor is still
            // black, so I'm making the background transparent black, which makes the cursor white;
            //txtName.Background = new SolidColorBrush(Color.FromArgb(0, 0, 0, 0));
            txtName.Background = new SolidColorBrush(Color.FromArgb(0, colors.Background.R, colors.Background.G, colors.Background.B));

            txtName.Foreground = new SolidColorBrush(colors.PartVisual_TextColor);
        }
Esempio n. 7
0
        public DraggableModifierRing(Quaternion orientation, double radius, EditorColors editorColors)
            : base(editorColors)
        {
            _initialOrientation = orientation;
            _radius             = radius;

            _initialRotateTransform = new RotateTransform3D(new QuaternionRotation3D(_initialOrientation));
            _intialAxisX            = _initialRotateTransform.Transform(new Vector3D(1, 0, 0));
            _intialAxisY            = _initialRotateTransform.Transform(new Vector3D(0, 1, 0));
            _intialAxisZ            = _initialRotateTransform.Transform(new Vector3D(0, 0, 1));

            this.Model         = new ModelVisual3D();
            this.Model.Content = GetRing();
        }
 public DraggableModifierArrow(Quaternion rotation, EditorColors editorColors)
     : base(editorColors)
 {
     this.Model = new ModelVisual3D();
     this.Model.Content = GetArrow(rotation);
 }
        public DraggableModifierRing(Quaternion orientation, double radius, EditorColors editorColors)
            : base(editorColors)
        {
            _initialOrientation = orientation;
            _radius = radius;

            _initialRotateTransform = new RotateTransform3D(new QuaternionRotation3D(_initialOrientation));
            _intialAxisX = _initialRotateTransform.Transform(new Vector3D(1, 0, 0));
            _intialAxisY = _initialRotateTransform.Transform(new Vector3D(0, 1, 0));
            _intialAxisZ = _initialRotateTransform.Transform(new Vector3D(0, 0, 1));

            this.Model = new ModelVisual3D();
            this.Model.Content = GetRing();
        }
Esempio n. 10
0
        protected static UIElement GetVisual2D_OLD(string text, string description, EditorColors editorColors)
        {
            //TODO:  Use icons with tooltips

            Border retVal = new Border()
            {
                Background = Brushes.Transparent,       // this is needed for drag/drop to work
                BorderBrush = new SolidColorBrush(editorColors.PartVisual_BorderColor),
                BorderThickness = new Thickness(1d),
                CornerRadius = new CornerRadius(3d),
                Margin = new Thickness(2d),
            };

            TextBlock textblock = new TextBlock()
            {
                Text = text,
                ToolTip = description,
                Foreground = new SolidColorBrush(editorColors.PartVisual_TextColor),
                FontSize = 10d,
                Margin = new Thickness(3d, 1d, 3d, 1d),
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment = VerticalAlignment.Center,
            };

            retVal.Child = textblock;

            return retVal;
        }
Esempio n. 11
0
 protected DraggableModifierBase(EditorColors editorColors)
 {
     this.EditorColors = editorColors;
 }
 public TabControlPartsVM(EditorColors colors)
 {
     _colors = colors;
     this.Tabs = new ObservableCollection<TabItem>();
 }
Esempio n. 13
0
 public TabControlPartsVM(EditorColors colors)
 {
     _colors   = colors;
     this.Tabs = new ObservableCollection <TabItem>();
 }
Esempio n. 14
0
        private ModelVisual3D GetCompassRose(EditorColors colors)
        {
            Model3DGroup models = new Model3DGroup();

            #region Ring

            // Material
            MaterialGroup material = new MaterialGroup();
            material.Children.Add(new DiffuseMaterial(new SolidColorBrush(_options.EditorColors.CompassRose_Color)));
            material.Children.Add(_options.EditorColors.CompassRose_Specular);

            // Geometry Model
            GeometryModel3D geometry = new GeometryModel3D();
            geometry.Material = material;
            geometry.BackMaterial = material;
            geometry.Geometry = UtilityWPF.GetTorus(100, 20, .12, 10);

            Transform3DGroup transforms = new Transform3DGroup();
            transforms.Children.Add(new ScaleTransform3D(1d, 1d, .16d));
            transforms.Children.Add(new TranslateTransform3D(new Vector3D(0, 0, -8)));
            geometry.Transform = transforms;

            models.Children.Add(geometry);

            #endregion
            #region Arrow 1

            // Material
            material = new MaterialGroup();
            material.Children.Add(new DiffuseMaterial(new SolidColorBrush(_options.EditorColors.CompassRose_Color)));
            material.Children.Add(_options.EditorColors.CompassRose_Specular);

            // Geometry Model
            geometry = new GeometryModel3D();
            geometry.Material = material;
            geometry.BackMaterial = material;
            geometry.Geometry = UtilityWPF.GetCone_AlongX(20, .96, 2d);

            transforms = new Transform3DGroup();
            transforms.Children.Add(new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(0, 1, 0), 180)));
            transforms.Children.Add(new ScaleTransform3D(1d, 1d, .02d));
            transforms.Children.Add(new TranslateTransform3D(new Vector3D(-11, 0, -8)));
            geometry.Transform = transforms;

            models.Children.Add(geometry);

            #endregion
            #region Arrow 2

            // Material
            material = new MaterialGroup();
            material.Children.Add(new DiffuseMaterial(new SolidColorBrush(_options.EditorColors.CompassRose_Color)));
            material.Children.Add(_options.EditorColors.CompassRose_Specular);

            // Geometry Model
            geometry = new GeometryModel3D();
            geometry.Material = material;
            geometry.BackMaterial = material;
            geometry.Geometry = UtilityWPF.GetCone_AlongX(20, .48, 1.5d);

            transforms = new Transform3DGroup();
            transforms.Children.Add(new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(0, 1, 0), 180)));
            transforms.Children.Add(new ScaleTransform3D(1d, 1d, .04d));
            transforms.Children.Add(new TranslateTransform3D(new Vector3D(9.25, 0, -8)));
            geometry.Transform = transforms;

            models.Children.Add(geometry);

            #endregion
            #region Origin Dot

            // Material
            material = new MaterialGroup();
            material.Children.Add(new DiffuseMaterial(new SolidColorBrush(_options.EditorColors.CompassRose_Color)));
            material.Children.Add(_options.EditorColors.CompassRose_Specular);

            // Geometry Model
            geometry = new GeometryModel3D();
            geometry.Material = material;
            geometry.BackMaterial = material;
            geometry.Geometry = UtilityWPF.GetSphere_LatLon(20, .08, .08, .08);

            models.Children.Add(geometry);

            #endregion

            ModelVisual3D retVal = new ModelVisual3D();        // this is the expensive one, so as few of these should be made as possible
            retVal.Content = models;

            // Exit Function
            return retVal;
        }
        public TabControlPartsVM_FixedSupply(EditorColors colors, IEnumerable<PartDesignBase> parts)
            : base(colors)
        {
            _brushPrimary = new SolidColorBrush(_colors.TabIcon_Primary);
            _brushSecondary = new SolidColorBrush(_colors.TabIcon_Secondary);

            _tabParts.CollectionChanged += TabParts_CollectionChanged;

            foreach (PartDesignBase part in parts)
            {
                AddToTab(part);
            }
        }
 protected DraggableModifierBase(EditorColors editorColors)
 {
     this.EditorColors = editorColors;
 }
Esempio n. 17
0
 public DraggableModifierArrow(Quaternion rotation, EditorColors editorColors)
     : base(editorColors)
 {
     this.Model         = new ModelVisual3D();
     this.Model.Content = GetArrow(rotation);
 }
        public TabControlPartsVM_CreateNew(EditorColors colors, IEnumerable<PartToolItemBase> parts)
            : base(colors)
        {
            _parts = parts.ToArray();

            BuildToolBox(_parts);
        }