// // Used by Square and Rectangle // public static FigSynthProblem MakeAdditionProblem(Figure outerShape, Figure appended) { if (outerShape.Contains(appended) || appended.Contains(outerShape) || outerShape.Overlaps(appended)) { return(null); } AdditionSynth addSynth = new AdditionSynth(outerShape, appended); List <AtomicRegion> atoms = new List <AtomicRegion>(); atoms.Add(outerShape.GetFigureAsAtomicRegion()); atoms.Add(appended.GetFigureAsAtomicRegion()); addSynth.SetOpenRegions(atoms); return(addSynth); }
// // A shape within this shape? // public virtual bool Contains(Figure that) { return thisAtomicRegion.Contains(that.GetFigureAsAtomicRegion()); }
public bool Overlaps(Figure that) { return this.GetFigureAsAtomicRegion().OverlapsWith(that.GetFigureAsAtomicRegion()); }
// // Used by Square and Rectangle // public static FigSynthProblem MakeAdditionProblem(Figure outerShape, Figure appended) { if (outerShape.Contains(appended) || appended.Contains(outerShape) || outerShape.Overlaps(appended)) return null; AdditionSynth addSynth = new AdditionSynth(outerShape, appended); List<AtomicRegion> atoms = new List<AtomicRegion>(); atoms.Add(outerShape.GetFigureAsAtomicRegion()); atoms.Add(appended.GetFigureAsAtomicRegion()); addSynth.SetOpenRegions(atoms); return addSynth; }
// // A shape within this shape? // public virtual bool Contains(Figure that) { return thisAtomicRegion.Contains(that.GetFigureAsAtomicRegion()); }
public bool Overlaps(Figure that) { return(this.GetFigureAsAtomicRegion().OverlapsWith(that.GetFigureAsAtomicRegion())); }