-
-
Save gksriharsha/90a2d69f5a1af687eee23b3d4c43770e to your computer and use it in GitHub Desktop.
Audience Stand capturing the appropriate information.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AudienceStand: | |
def __init__(self,top_left,top_right,bottom_right,bottom_left,stand_name, capacity=None, seat_size=None): | |
self.stand = stand_name | |
self.top_left = top_left | |
self.top_right = top_right | |
self.bottom_right = bottom_right | |
self.bottom_left = bottom_left | |
self.fill_perc = 0 | |
self.capacity = capacity | |
self.seat_size = seat_size # Used for pixel binning. | |
self.stand_seats = path.Path([top_left,top_right,bottom_right,bottom_left]) | |
self.stand_fill = np.array([top_left,top_right,bottom_right,bottom_left]) | |
self.stand_img = None | |
def within_stand(self,point): | |
return self.stand_seats.contains_point(point) | |
def __str__(self) -> str: | |
return self.stand | |
def update_fill(self,fill_value): | |
self.fill_perc = fill_value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment