* updating exclusion domain - update sample/ is_inside - create tests * difference fixes - random iteration list for sample * created Intersection * created a Difference domain * unittest * docstrings and minor fixes * Refacotring Geometries - added OperationInterface - redid test cases - edited Union, Intersect, Exclusion, and Difference to inherit from OperationInterface - simplified Union, Intersect, Exclusion, and Difference * rm lighting logs --------- Co-authored-by: Dario Coscia <dariocoscia@cli-10-110-16-239.WIFIeduroamSTUD.units.it>
31 lines
881 B
Python
31 lines
881 B
Python
"""Module for Location class."""
|
|
|
|
from abc import ABCMeta, abstractmethod
|
|
|
|
|
|
class Location(metaclass=ABCMeta):
|
|
"""
|
|
Abstract Location class.
|
|
Any geometry entity should inherit from this class.
|
|
"""
|
|
@abstractmethod
|
|
def sample(self):
|
|
"""
|
|
Abstract method for sampling a point from the location. To be
|
|
implemented in the child class.
|
|
"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def is_inside(self, point, check_border=False):
|
|
"""
|
|
Abstract method for checking if a point is inside the location. To be
|
|
implemented in the child class.
|
|
|
|
:param tensor point: A tensor point to be checked.
|
|
:param bool check_border: a boolean that determines whether the border
|
|
of the location is considered checked to be considered inside or
|
|
not. Defaults to False.
|
|
"""
|
|
pass
|