Ejemplo n.º 1
0
        protected override SamplerStatus Sampler(JigPrompts prompts)
        {
            JigPromptPointOptions ppo = new JigPromptPointOptions("\nУкажите точку");

            ppo.UseBasePoint = true;
            ppo.BasePoint    = InsertPointUcs.TransformBy(ToWcsTransform);

            ppo.UserInputControls = UserInputControls.NoZeroResponseAccepted;

            PromptPointResult ppr = prompts.AcquirePoint(ppo);

            if (ppr.Status != PromptStatus.OK)
            {
                return(SamplerStatus.Cancel);
            }

            if ((_jigPositionUcs - ppr.Value.TransformBy(ToUcsTransform)).Length < 0.1 * _step)
            {
                return(SamplerStatus.NoChange);
            }

            _jigPositionUcs = ppr.Value.TransformBy(ToUcsTransform);

            return(SamplerStatus.OK);
        }
Ejemplo n.º 2
0
        public void Calculate(Point3d upperRightPointUcs)
        {
            double   dx  = InsertPointUcs.X % _step;
            double   dy  = InsertPointUcs.Y % _step;
            Matrix3d mat = Matrix3d.Identity;

            mat = mat.PreMultiplyBy(Matrix3d.Displacement(_ucs.CoordinateSystem3d.Xaxis.Negate().MultiplyBy(dx)))
                  .PreMultiplyBy(Matrix3d.Displacement(_ucs.CoordinateSystem3d.Yaxis.Negate().MultiplyBy(dy)));

            _boundRectg = SimpleGride.CreateRectangle(InsertPointUcs.TransformBy(mat), upperRightPointUcs, InnerBlockTransform.CoordinateSystem3d);

            SimpleGride grid = new SimpleGride(InsertPointUcs.TransformBy(mat), _boundRectg.UpperLeft - _boundRectg.LowerLeft,
                                               _boundRectg.LowerRight - _boundRectg.LowerLeft, _step, _step);

            _innerGridUcs = grid;
        }