from supervisely.app import DataJson
from supervisely.app.widgets import Widget
from supervisely.annotation.obj_class import ObjClass


from supervisely.geometry.bitmap import Bitmap
from supervisely.geometry.alpha_mask import AlphaMask
from supervisely.geometry.cuboid import Cuboid
from supervisely.geometry.point import Point
from supervisely.geometry.polygon import Polygon
from supervisely.geometry.polyline import Polyline
from supervisely.geometry.rectangle import Rectangle
from supervisely.geometry.graph import GraphNodes
from supervisely.geometry.any_geometry import AnyGeometry
from supervisely.geometry.cuboid_3d import Cuboid3d
from supervisely.geometry.pointcloud import Pointcloud
from supervisely.geometry.point_3d import Point3d
from supervisely.geometry.multichannel_bitmap import MultichannelBitmap
from supervisely.geometry.closed_surface_mesh import ClosedSurfaceMesh


type_to_zmdi_icon = {
    AnyGeometry: "zmdi zmdi-shape",
    Rectangle: "zmdi zmdi-crop-din",  # "zmdi zmdi-square-o"
    # Polygon: "icons8-polygon",  # "zmdi zmdi-edit"
    Bitmap: "zmdi zmdi-brush",
    AlphaMask: "zmdi zmdi-brush",
    Polyline: "zmdi zmdi-gesture",
    Point: "zmdi zmdi-dot-circle-alt",
    Cuboid: "zmdi zmdi-ungroup",  #
    # Cuboid3d: "zmdi zmdi-codepen",
    Pointcloud: "zmdi zmdi-cloud-outline",  #  # "zmdi zmdi-border-clear"
    MultichannelBitmap: "zmdi zmdi-layers",  # "zmdi zmdi-collection-item"
    Point3d: "zmdi zmdi-filter-center-focus",  # "zmdi zmdi-select-all"
}

type_to_icons8_icon = {
    Polygon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAB6klEQVRYhe2Wuy8EURTGf+u5VESNXq2yhYZCoeBv8RcI1i6NVUpsoVCKkHjUGlFTiYb1mFmh2MiKjVXMudmb3cPOzB0VXzKZm5k53/nmvO6Ff4RHD5AD7gFP1l3Kd11AHvCBEpAVW2esAvWmK6t8l1O+W0lCQEnIJoAZxUnzNQNkZF36jrQjgoA+uaciCgc9V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LThI6fYYJYpB11Pb9/Wtf3SYXBlid8FwIb1szZkrXKFVH3J9WOgV8o/RFrygZG5Ls3cj7cWgQcHVcVKdSE1nxv8QRw1J43KfZKGRdPwYI4s/NGpiOOSeqxwAAAAASUVORK5CYII=",
    Cuboid3d: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAAA/0lEQVRIieXVQUoDQRAF0EdwmQO4iXcQouAhXHgBb5CcwW3ceQUXXsClq2QX8AR6BhG3AdGF3VCOPTOdMYLoh4Kh+VW/u6vnF/8FY8zwkGKW1r6NfVzgCW+NeMEVDoYUPsINNqHgCmcpVmF9k7jTvqIjnOIuJL/iFicF/iGuG5u4xzn2SgLrQHzGApPes35wFikn56/jrjOOK4rVolgr3nXN/U6V+5S/WwW6kmuaXCWQMeSZbiWQMcY8cObaf7RBAoM5ow7iTvA3Bboa2IX8EFqx9NkqLn21ilKTJ4kbrWJZEqgxuyiwtdlF9NnAILsu4ccGThN5ZD6m2NnI/P14BxLdhg05U8R5AAAAAElFTkSuQmCC",  # "zmdi zmdi-codepen"
    # ClosedSurfaceMesh: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAABmJLR0QA/wD/AP+gvaeTAAAIRElEQVRoge2aebCWZRXAf98NBLymF5cwLLVkUZawZpzcozAjkmVywcoUZVoccktHWaSMrAgH1Cy5SZoB6rgbRShpgIxrQCGIoKM14xYgXpALyl2+tz/OOT3nfe7zfvfjcsdxGs/MM+/7nPc8y3mes38ffAgfLCh10jw9gPOAy4FDgC3a3gI2R3173+z6OzppHx2Gg4BrgE1AtgdtDTDkfd47AH2B2cBOt5kngDOA+x3uMeBbwMXAT4DfI6efYuY94Aqg5v1g4HjgAaBVF28FHlS8QQmY4mjuBYYBtwHvuI1vB24Hvu9oM2AJcOjubqwaHakBRiOn5Tf8FjAfEas6bT3d+wCgNporA5YpA/cDjYqfCfzQ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GvNdUAX0NS4lOieTPEUh2t79ciJroncnv+ae/9gAPcHPVUTqWrhhKhNGRyfFiCritSd4pN+J60fyDOut0NVgtdkfKQlX2uQwoCQ5DEazBwlNKloIzEVfazXYO2d5HfSIZEtIsRy7hQ+50KtcDTVD7BNxB9uApheihB5se5uT4F/JK8WX8bcZp9OnvjKTiQfCiTatuQ6uDdwM8IJZ0diKL/iXwJaCXi+JKJUjWwJ/9F6Ql82rWBiIPsixSs24MmpNJ4CyGH7zB01p9qYuiFWJ4+2vq69y1IgHkrIlYfwv8l/Be10I+Lw2RRlwAAAABJRU5ErkJggg==",
    # ClosedSurfaceMesh: "data:image/png;base64,[encoded data, 4120 characters]",
    ClosedSurfaceMesh: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAACl0lEQVRYhe3WT4jVVRQH8M/4B50SQXIxg9iihsRFQjkuoihdVCQoUlCunKChZZQLSRRJamB03WYMAqVFi4JJaaOI2KJGotmILkboD/mHyqIZnJGaZp6Le368+9783rw/03K+cHn3nXPuOd/fveece1nGMprjZUyj0uaYw0dLDd6NHzsIXoxZbFsKgQ/C0e/x+y92N7B9CJ+rfv14zC91GvxRaevn8QKGwuEMnq2z3YzvQz+FfdiQEd/fCYGzsfhM/O/CJyG7i60hfx6/hXwik8NgyO9gfTvBd8fCSfRm8lX4KnS/4Jh0zpUgXB9kBa6E/kSrwdfgRiw6WKLfJO1AnmwnIlgZdkg58Q+2tELgaDi9htWZ/GmMKC/JaZzDATxc4vNU2F1oFrxIvAp2YW04HcuCzeHr7P+4WjJ/S3mzR9pN2Ig/Q//qYgS+CKPvMIw/Msd3cRKPhW0hhz4cbkLm3ZD9LJXsArxk4dZWpCQaiN3IkRPI0Yf38UOdn6ls/mEZgauZwQw+RX+ZYRMCOR5vQOa+qK48c5s56wR/SUc3KTW0Al1lxi/6f46gG29gVCq9wi6fDzVinCfhSbX1vlgSrsIrUsLlZ/0fzuNNHFJtYKVJSG0Z7oyvHlDtZmVl+LFqzy/GGN5BT/h9JPuY1xoFL3BEeSParnEjquC6dHs+UeJzRIuNiNQ8JmLBeyX6Xgu/+Pgi/vq12YpJ51lcRj2ZvAufhe4Wvoz5vNS4Vtb5yS+j4VaDFxiNhaczWfEmmMJTIXtbeqhUcLmOcHEd/4p17RKof5C8pZrZe+tsn8Pt0N/EM2ofJK+3G7zAsXDwk+q9P9jAthffqNb8tzG/2GlwahOykzGLJ5dCgNQh73UQfF4qy2UsY1E8AG0sM2O2giC0AAAAAElFTkSuQmCC",
    # Point3d: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAABqUlEQVRYhe3TsWtUQRDH8U/UHEQwFzQqGhGsLAKChY0pUtiLiiD+B6L+CSLYmNjam04btdLGTgStgo0iUUs5IwcWXrBR8Cx2l6yX9+4luTuC8L6w3DEzO/N7M7PU1NT8h5zBfbzDD/zEJzzA/CgLH8IjdCvOCxwfdvET+BwLfMMdnEYTe3EKt7AaY1ajbSCO4TE6+B0TP8X+Pnea8U4XX3B4kOLf/dvaJ9i9ibu7MhEPtysgJXiGGRzEROZv4B6+ooWFaEs00cYfnNyOgE4UMFPiX7Rx+e72xNy2vjPPcVXoTl8msJQlbZbEtaL/LObi/1ZPzGyByFeYLis+Jsy5K7zr830Ut2PcXCagXZBvXzwXsBLj3mC8KOmVGPARB8pURopGsFhxZyoTca0o4GV0Xq5IBHuExUvFF6KtikvWu7CB9Oyqvj4nCdgskzG+kwz5jNNcfm0h4VYZ6zXkAj7E33MjFJByvy9y3hTasyIszLCZEha8i+tFAQ28zURcFGY2KJPC8qXiy0qeIRzNRIziLONIleIGbghPZW0IRdfwWmh76ZfX1NTsGH8BaEidOSWP5WoAAAAASUVORK5CYII=",
}

type_to_shape_text = {
    AnyGeometry: "any shape",
    Rectangle: "rectangle",
    Polygon: "polygon",
    Bitmap: "bitmap (mask)",
    AlphaMask: "alpha mask",
    Polyline: "polyline",
    Point: "point",
    Cuboid: "cuboid",  #
    Cuboid3d: "cuboid 3d",
    Pointcloud: "pointcloud",  #  # "zmdi zmdi-border-clear"
    MultichannelBitmap: "n-channel mask",  # "zmdi zmdi-collection-item"
    Point3d: "point 3d",  # "zmdi zmdi-select-all"
    GraphNodes: "keypoints",
    ClosedSurfaceMesh: "volume (3d mask)",
}


class ObjectClassView(Widget):
    def __init__(
        self,
        obj_class: ObjClass,
        show_shape_text: bool = True,
        show_shape_icon: bool = False,
        widget_id: str = None,
    ):
        self._obj_class = obj_class
        self._show_shape_text = show_shape_text
        self._show_shape_icon = show_shape_icon
        super().__init__(widget_id=widget_id, file_path=__file__)

    def get_json_data(self):
        res = self._obj_class.to_json()
        res["icon"] = None
        res["icon8"] = None
        if self._show_shape_icon is True:
            res["icon"] = type_to_zmdi_icon.get(self._obj_class.geometry_type)
            res["icon8"] = type_to_icons8_icon.get(self._obj_class.geometry_type)
        res["shape_text"] = None
        if self._show_shape_text is True:
            res["shape_text"] = type_to_shape_text.get(
                self._obj_class.geometry_type
            ).upper()
        return res

    def get_json_state(self):
        return None
