Пример #1
0
        protected override bool IsComparable(ImplicitToolBase tool)
        {
            bool result = false;

            if ((tool != null) && (tool is ImplicitAxAlignedTool aaTool))
            {
                if ((DirKey == aaTool.DirKey) &&
                    (_axisComponent == aaTool._axisComponent) &&
                    (_radius == aaTool._radius) &&
                    (_length == aaTool._length))
                {
                    result = true;
                }
            }

            return(result);
        }
Пример #2
0
        public AlongDirectionSemplificationCheckResult Check(ImplicitToolBase tool)
        {
            var result = AlongDirectionSemplificationCheckResult.None;

            if (IsComparable(tool))
            {
                var d = tool._position - _position;
                var p = CheckParallel(d);

                if (p > 0)
                {
                    result = AlongDirectionSemplificationCheckResult.GoOn;
                }
                else if (p < 0)
                {
                    result = AlongDirectionSemplificationCheckResult.BackOff;
                }
            }

            return(result);
        }
        public static ImplicitToolBase Create(Vector3d position, Vector3d direction, double length, double radius)
        {
            ImplicitToolBase result = null;

            if ((direction.x == 0) && (direction.y == 0))
            {
                result = new ImplicitToolZ(position, length, radius, direction.z > 0);
            }
            else if ((direction.z == 0) && (direction.y == 0))
            {
                result = new ImplicitToolX(position, length, radius, direction.x > 0);
            }
            else if ((direction.x == 0) && (direction.z == 0))
            {
                result = new ImplicitToolY(position, length, radius, direction.y > 0);
            }
            else
            {
                throw new NotImplementedException();
            }

            return(result);
        }
Пример #4
0
 protected abstract bool IsComparable(ImplicitToolBase tool);