示例#1
0
        public void AddObject3DControls(Object3DControlsLayer object3DControlsLayer)
        {
            var getDiameters = new List <Func <double> >()
            {
                () => OuterDiameter.Value(this), () => InnerDiameter.Value(this)
            };
            var setDiameters = new List <Action <double> >()
            {
                (diameter) => OuterDiameter = diameter, (diameter) => InnerDiameter = diameter
            };

            object3DControlsLayer.Object3DControls.Add(new ScaleDiameterControl(object3DControlsLayer,
                                                                                null,
                                                                                null,
                                                                                getDiameters,
                                                                                setDiameters,
                                                                                0,
                                                                                ObjectSpace.Placement.Center));
            object3DControlsLayer.Object3DControls.Add(new ScaleDiameterControl(object3DControlsLayer,
                                                                                null,
                                                                                null,
                                                                                getDiameters,
                                                                                setDiameters,
                                                                                1,
                                                                                ObjectSpace.Placement.Center,
                                                                                angleOffset: -MathHelper.Tau / 32));
            object3DControlsLayer.AddControls(ControlTypes.MoveInZ);
            object3DControlsLayer.AddControls(ControlTypes.RotateXYZ);
        }
示例#2
0
        public void AddObject3DControls(Object3DControlsLayer object3DControlsLayer)
        {
            double getHeight() => Height.Value(this);
            void setHeight(double height) => Height = height;

            var getDiameters = new List <Func <double> >()
            {
                () => OuterDiameter.Value(this), () => InnerDiameter.Value(this)
            };
            var setDiameters = new List <Action <double> >()
            {
                (diameter) => OuterDiameter = diameter, (diameter) => InnerDiameter = diameter
            };

            object3DControlsLayer.Object3DControls.Add(new ScaleDiameterControl(object3DControlsLayer,
                                                                                getHeight,
                                                                                setHeight,
                                                                                getDiameters,
                                                                                setDiameters,
                                                                                0));
            object3DControlsLayer.Object3DControls.Add(new ScaleDiameterControl(object3DControlsLayer,
                                                                                getHeight,
                                                                                setHeight,
                                                                                getDiameters,
                                                                                setDiameters,
                                                                                1,
                                                                                angleOffset: -MathHelper.Tau / 32));
            object3DControlsLayer.Object3DControls.Add(new ScaleHeightControl(object3DControlsLayer,
                                                                              null,
                                                                              null,
                                                                              null,
                                                                              null,
                                                                              getHeight,
                                                                              setHeight,
                                                                              getDiameters,
                                                                              setDiameters));
            object3DControlsLayer.AddControls(ControlTypes.MoveInZ);
            object3DControlsLayer.AddControls(ControlTypes.RotateXYZ);
        }