예제 #1
0
        public override bool GetGripPoints(GripPointsInfo info)
        {
            //frist grip to move
            info.AppendGrip(new McSmartGrip <Ball>(_basePnt + new Vector3d(0, _radius, 0), (obj, g, offset) => {
                obj.TryModify();
                obj._basePnt += offset;
                obj.TryModify();
                obj.ShakePredict();
            }));

            //command grip
            var ctxGrip = new McSmartGrip <Ball>(McBaseGrip.GripType.PopupMenu, 2, _basePnt - 1.0 * new Vector3d(_radius, 0, 0),
                                                 McBaseGrip.GripAppearance.PopupMenu, 0, "Select menu", Color.Lime);

            ctxGrip.GetContextMenu = (obj, items) =>
            {
                items.Add(new ContextMenuItem("Get prediction", "none", 1));
                items.Add(new ContextMenuItem("Edit predictions", "none", 2));
            };
            ctxGrip.OnCommand = (obj, commandId, grip) =>
            {
                if (grip.Id == 2)
                {
                    switch (commandId)
                    {
                    case 1:
                    {
                        ShakePredict();
                        break;
                    }

                    case 2:
                    {
                        CallForm();
                        break;
                    }
                    }
                }
            };
            info.AppendGrip(ctxGrip);
            return(true);
        }
 // Create a grip for the base point of the object
 public override bool GetGripPoints(GripPointsInfo info)
 {
     info.AppendGrip(new McSmartGrip <DoorPseudo3D_nc51>(_pnt1, (obj, g, offset) => { obj.TryModify(); obj._pnt1 += offset; }));
     return(true);
 }