Esempio n. 1
0
        //
        // 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);
        }
Esempio n. 2
0
 //
 // A shape within this shape?
 //
 public virtual bool Contains(Figure that)
 {
     return thisAtomicRegion.Contains(that.GetFigureAsAtomicRegion());
 }
Esempio n. 3
0
 public bool Overlaps(Figure that)
 {
     return this.GetFigureAsAtomicRegion().OverlapsWith(that.GetFigureAsAtomicRegion());
 }
Esempio n. 4
0
        //
        // 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;
        }
Esempio n. 5
0
 //
 // A shape within this shape?
 //
 public virtual bool Contains(Figure that)
 {
     return thisAtomicRegion.Contains(that.GetFigureAsAtomicRegion());
 }
Esempio n. 6
0
 public bool Overlaps(Figure that)
 {
     return(this.GetFigureAsAtomicRegion().OverlapsWith(that.GetFigureAsAtomicRegion()));
 }