示例#1
0
    def append(self, box):
        """Append a Bbox object to a Boxlist object, using the
        ``Vect_boxlist_append`` C fuction. ::

            >>> box0 = Bbox()
            >>> box1 = Bbox(1,2,3,4)
            >>> box2 = Bbox(5,6,7,8)
            >>> boxlist = BoxList([box0, box1])
            >>> boxlist
            Boxlist([Bbox(0.0, 0.0, 0.0, 0.0), Bbox(1.0, 2.0, 3.0, 4.0)])
            >>> len(boxlist)
            2
            >>> boxlist.append(box2)
            >>> len(boxlist)
            3

        ..
        """
        indx = self.__len__()
        libvect.Vect_boxlist_append(self.c_boxlist, indx, box.c_bbox.contents)
示例#2
0
    def append(self, box):
        """Append a Bbox object to a Boxlist object, using the
        ``Vect_boxlist_append`` C function.

        :param bbox: the bounding box to add to the list
        :param bbox: a Bbox object

        >>> box0 = Bbox()
        >>> box1 = Bbox(1,2,3,4)
        >>> box2 = Bbox(5,6,7,8)
        >>> boxlist = BoxList([box0, box1])
        >>> boxlist
        Boxlist([Bbox(0.0, 0.0, 0.0, 0.0), Bbox(1.0, 2.0, 3.0, 4.0)])
        >>> len(boxlist)
        2
        >>> boxlist.append(box2)
        >>> len(boxlist)
        3

        """
        indx = self.__len__()
        libvect.Vect_boxlist_append(self.c_boxlist, indx, box.c_bbox)