示例#1
0
        public NewConeView(NewConeViewModel viewModel, ILoggerFacade logger)
            : base(viewModel, logger)
        {
            this.viewModel = viewModel;

            cylinder = new Cylinder();
            Children.Add(cylinder);

            cylinder.Bind(Cylinder.Radius1Property, () => viewModel.TopRadius);
            cylinder.Bind(Cylinder.Radius2Property, () => viewModel.BottomRadius);
            cylinder.Bind(Cylinder.Point1Property,
                          () => viewModel.Center,
                          () => viewModel.Axis,
                          () => viewModel.Length,
                          (center, axis, length) => center + 0.5 * length * axis);
            cylinder.Bind(Cylinder.Point2Property,
                          () => viewModel.Center,
                          () => viewModel.Axis,
                          () => viewModel.Length,
                          (center, axis, length) => center - 0.5 * length * axis);

            cylinder.SetMaterials(GetDefaultFrontAndBackMaterials(viewModel));
        }
示例#2
0
 public Editor(Point startPoint, LineRange startRay, NewConeViewModel viewModel)
     : base(startPoint, startRay, viewModel)
 {
     this.viewModel = viewModel;
 }