Changeset 3574

Show
Ignore:
Timestamp:
07/23/08 13:02:25 (4 months ago)
Author:
ksprotte
Message:

working on allocation

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/projects/bos/m2/allocation.lisp

    r3545 r3574  
    562562                          (cond 
    563563                            ((null m2) 
    564                              (return nil)) 
    565                             ((not (in-polygon-p (m2-x m2) (m2-y m2) vertices)) 
    566                              (when (and (stripe-dissection-p (m2-x m2) stripe) 
    567                                         (or result new-seen)) 
    568                                ;; Wenn wir hier weitermachen und das Polygon 
    569                                ;; nicht konvex ist, ist das Ergebnis nicht 
    570                                ;; zusammenhaengend.  Also aufgeben und in der 
    571                                ;; rechten Haelfe des Stripes weitermachen. 
    572                                (setf x new-x 
    573                                      y new-y 
    574                                      seen (append new-seen (reverse result))) 
    575                                (let ((right (split-stripe-vertically stripe))) 
    576                                  (return-from find-free-m2s/stripe 
    577                                    (if right 
    578                                        (find-free-m2s/stripe n right) 
    579                                        nil))))) 
     564                             (return nil))                                                                                      
     565                            ((or (not (m2s-connected-p result)) 
     566                                 (and (not (in-polygon-p (m2-x m2) (m2-y m2) vertices)) 
     567                                      (stripe-dissection-p (m2-x m2) stripe) 
     568                                      (or result new-seen)))                         
     569                             ;; Wenn wir hier weitermachen und das Polygon 
     570                             ;; nicht konvex ist, ist das Ergebnis nicht 
     571                             ;; zusammenhaengend.  Also aufgeben und in der 
     572                             ;; rechten Haelfe des Stripes weitermachen. 
     573                             (setf x new-x 
     574                                   y new-y 
     575                                   seen (append new-seen (reverse result))) 
     576                             (let ((right (split-stripe-vertically stripe))) 
     577                               (return-from find-free-m2s/stripe 
     578                                 (if right 
     579                                     (find-free-m2s/stripe n right) 
     580                                     nil)))) 
    580581                            ((null (m2-contract m2)) 
    581582                             (return m2)))))))) 
     
    586587                          seen new-seen) 
    587588                    (when result 
     589                      (assert (= (length result) n)) 
    588590                      (with-slots (area) stripe 
    589                         (decf (allocation-area-free-m2s area) n) 
     591                        (print (list '********** 'will-decrease-count-by n))                         
     592                        (decf (allocation-area-free-m2s area) n) 
    590593                        (when (null (allocation-area-free-m2s area)) 
    591594                          (deactivate-allocation-area area))))