示例#1
0
        public Shape3D FindIntersection(Shape3D shape)
        {
            // ensure that 'this' is less or as primative as shape
             if (Type > shape.Type)
            return shape.FindIntersection(this);

             // find intersection
             if (this.Type == ShapeType3D.Point)
            return shape.Contains((Point3D)this) ? this : null;
             else if (this.Type == ShapeType3D.Line)
             {
            throw new NotImplementedException();
            //if (shape.Type == ShapeType3D.Line)
            //   return ((Line3D)this).FindLineIntersection((Line3D)shape);
             }
             throw new System.NotImplementedException("Intersection between " + shape.Type + " and " + Type + " not implemented.");
        }
示例#2
0
        public Shape3D FindIntersection(Shape3D shape)
        {
            // ensure that 'this' is less or as primative as shape
            if (Type > shape.Type)
            {
                return(shape.FindIntersection(this));
            }

            // find intersection
            if (this.Type == ShapeType3D.Point)
            {
                return(shape.Contains((Point3D)this) ? this : null);
            }
            else if (this.Type == ShapeType3D.Line)
            {
                throw new NotImplementedException();
                //if (shape.Type == ShapeType3D.Line)
                //   return ((Line3D)this).FindLineIntersection((Line3D)shape);
            }
            throw new System.NotImplementedException("Intersection between " + shape.Type + " and " + Type + " not implemented.");
        }