Example #1
0
        public void RemoveDeformationOp(IVectorDisplacementSourceOp op)
        {
            SceneObject so = SO_Op.Find(op);

            Combiner.Remove(op);
            SO_Op.Remove(op);

            OnDeformationRemoved?.Invoke(so, op);
        }
        public SpatialEditDeformOpSOBehavior(FContext context, BaseSO sourceSO, DMeshSO legSO, IVectorDisplacementSourceOp op) : base(context)
        {
            this.sourceSO = sourceSO;
            this.legSO    = legSO;
            this.op       = op;

            this.WantsCaptureF  = wants_capture;
            base.BeginCaptureF  = begin_capture;
            base.UpdateCaptureF = update_capture;
        }
Example #3
0
 static void add_input_behaviors_for_mouse(BaseSO so, IVectorDisplacementSourceOp op)
 {
     if (op is EnclosedRegionOffsetOp)
     {
         EnclosedRegionOffsetOp deformOp = op as EnclosedRegionOffsetOp;
         so.InputBehaviors.Add(
             new RightMouseClickDragBehavior()
         {
             WantsCaptureF  = (input) => { return(input.bCtrlKeyDown); },
             UpdateCaptureF = (input, lastInput) => {
                 deformOp.PushPullDistance += input.vMouseDelta2D.x * 0.1;
             }
         });
     }
     else if (op is EnclosedRegionSmoothOp)
     {
         EnclosedRegionSmoothOp deformOp = op as EnclosedRegionSmoothOp;
         so.InputBehaviors.Add(
             new RightMouseClickDragBehavior()
         {
             WantsCaptureF  = (input) => { return(input.bCtrlKeyDown); },
             UpdateCaptureF = (input, lastInput) => {
                 deformOp.OffsetDistance += input.vMouseDelta2D.x * 0.1;
                 deformOp.SmoothAlpha    += input.vMouseDelta2D.y * 0.1;
             }
         });
     }
     else if (op is PlaneBandExpansionOp)
     {
         PlaneBandExpansionOp deformOp = op as PlaneBandExpansionOp;
         so.InputBehaviors.Add(
             new RightMouseClickDragBehavior()
         {
             WantsCaptureF  = (input) => { return(input.bCtrlKeyDown); },
             UpdateCaptureF = (input, lastInput) => {
                 deformOp.PushPullDistance += input.vMouseDelta2D.x * 0.1;
                 deformOp.BandDistance     += input.vMouseDelta2D.y * 0.1;
             }
         });
     }
 }
Example #4
0
 public static Action MakeSelectLegDeformationAction(IVectorDisplacementSourceOp op)
 {
     return(() => {
         OG.Model.SetActiveModelingOperator(op);
     });
 }
Example #5
0
 public static Action MakeDeleteLegDeformationAction(IVectorDisplacementSourceOp op)
 {
     return(() => {
         OG.Leg.RemoveDeformationOp(op);
     });
 }
Example #6
0
 internal static void notifyModelingOpRemoved(SceneObject so, IVectorDisplacementSourceOp op)
 {
     OnModelingOpRemoved?.Invoke(so, op);
 }
Example #7
0
 public void Remove(IVectorDisplacementSourceOp op)
 {
     Displacements.Remove(op);
 }
Example #8
0
 public void Append(IVectorDisplacementSourceOp op)
 {
     Displacements.Append(op);
 }