def GetBoundingBox(self): bbox = Geometry.BoundingQuad() bbox.InsertPoint(self.baseSegment.p1) bbox.InsertPoint(self.baseSegment.p2) bbox.InsertPoint(self.arrow.p2) return bbox
def GetBoundingBox(self): bbox = Geometry.BoundingQuad() for p in self.__polyline: bbox.InsertPoint(p) bbox.Expand(self.__width) return bbox
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
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
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
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
def GetBoundingBox(self): # Returns a BoundingBox object for current object return Geometry.BoundingQuad()