Example #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
Example #2
0
    def GetBoundingBox(self):
        bbox = Geometry.BoundingQuad()

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

        bbox.Expand(self.__width)

        return bbox
Example #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
Example #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
Example #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
Example #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
Example #7
0
 def GetBoundingBox(self):
     # Returns a BoundingBox object for current object
     return Geometry.BoundingQuad()