Пример #1
0
        public override MyShape Clone()
        {
            MyShapeRamp ramp1 = new MyShapeRamp();

            ramp1.Transformation = base.Transformation;
            ramp1.Boundaries     = this.Boundaries;
            ramp1.RampNormal     = this.RampNormal;
            ramp1.RampNormalW    = this.RampNormalW;
            return(ramp1);
        }
        private MyBrushRamp()
        {
            m_shape = new MyShapeRamp();
            m_transform = MatrixD.Identity;

            m_width = new MyBrushGUIPropertyNumberSlider(
                MinScale, MinScale, MaxScale,
                MySessionComponentVoxelHand.VOXEL_HALF,
                MyVoxelBrushGUIPropertyOrder.First, MyCommonTexts.VoxelHandProperty_Box_Width
            );
            m_width.ValueChanged += RecomputeShape;

            m_height = new MyBrushGUIPropertyNumberSlider(
                MinScale, MinScale, MaxScale,
                MySessionComponentVoxelHand.VOXEL_HALF,
                MyVoxelBrushGUIPropertyOrder.Second, MyCommonTexts.VoxelHandProperty_Box_Height
            );
            m_height.ValueChanged += RecomputeShape;

            m_depth = new MyBrushGUIPropertyNumberSlider(
                MinScale, MinScale, MaxScale,
                MySessionComponentVoxelHand.VOXEL_HALF,
                MyVoxelBrushGUIPropertyOrder.Third, MyCommonTexts.VoxelHandProperty_Box_Depth
            );
            m_depth.ValueChanged += RecomputeShape;

            m_list = new List<MyGuiControlBase>();
            m_width.AddControlsToList(m_list);
            m_height.AddControlsToList(m_list);
            m_depth.AddControlsToList(m_list);

            RecomputeShape();
        }