예제 #1
0
    def GetBoundingBox(self):

        bbox = Geometry.BoundingQuad()

        bbox.InsertPoint(self.baseSegment.p1)
        bbox.InsertPoint(self.baseSegment.p2)
        bbox.InsertPoint(self.arrow.p2)

        return bbox
예제 #2
0
    def GetBoundingBox(self):
        bbox = Geometry.BoundingQuad()

        for p in self.__polyline:
            bbox.InsertPoint(p)

        bbox.Expand(self.__width)

        return bbox
예제 #3
0
    def GetBoundingBox(self):

        # TODO: Improve bounding over arrow (not box)

        bbox = Geometry.BoundingQuad()

        bbox.InsertPoint(self.origin)
        bbox.InsertPoint(self.target)
        bbox.Expand(20)

        return bbox
예제 #4
0
    def GetBoundingBox(self):
        bbox = Geometry.BoundingQuad()

        for p in self.__shape:
            bbox.InsertPoint(p)

        for p in self.__shape:
            if (p.data):
                bbox.Expand(p.data.size)
                break

        return bbox
예제 #5
0
    def GetBoundingBox(self):
        bbox = Geometry.BoundingQuad()

        p = self.center.Copy()
        p.Move(Geometry.Vector2D(-1, -1), self.__size / 2.0)
        bbox.InsertPoint(p)
        p = self.center.Copy()
        p.Move(Geometry.Vector2D(-1, 1), self.__size / 2.0)
        bbox.InsertPoint(p)
        p = self.center.Copy()
        p.Move(Geometry.Vector2D(1, -1), self.__size / 2.0)
        bbox.InsertPoint(p)
        p = self.center.Copy()
        p.Move(Geometry.Vector2D(1, 1), self.__size / 2.0)
        bbox.InsertPoint(p)

        return bbox
예제 #6
0
    def Select(self, point):
        # Since river is a nonclosed polyline, we need to check the selection over each polyline segment

        i = 1
        while (i < len(self.__polyline)):
            seg = Geometry.Segment2D(self.__polyline[i - 1],
                                     self.__polyline[i])
            poly = seg.GetBounding(self.__width / 2.0)
            bbox = Geometry.BoundingQuad()
            for p in poly.shape:
                bbox.InsertPoint(p.p1)
            if (len(poly.shape) > 0):
                bbox.InsertPoint(poly.shape[-1].p2)
            if (bbox.IsInside(point)):
                return True

            i += 1

        return False
예제 #7
0
 def GetBoundingBox(self):
     # Returns a BoundingBox object for current object
     return Geometry.BoundingQuad()