@startuml

title Main class diagram of the plugin

package data {
    class PickleStream {
        +__init__(f)
        +read(n)
        +readLine()
        +get()
    }

    class Listener{
        +__init__(receiver)
        -getFromObj(arg)
        -closeAll()
        +try_open()
        +read()
    }

    class DomainInfo {
        +__init__(pstd_data=None, ll=None)
        +{static} restore(str)
    }

    class DomainInfo.SubDomainInfo {
        +__init__(di)
        +{static} restore(data)
    }

    class StaticData {
        +{static} read_pressure_level_data(dir, id, frame)
    }
}

package enums {
    class S {
        +BOUNDARY_ABSORPTION
        +BOUNDARY_LOCALLY_REACTING
    }

    class VisualisationType {
        +PLAIN
        +BOUNDARY
        +SUBDOMAIN
        +LISTENER
        +BAKED_SUBDOMAIN
    }
}

package bmesh {
    class Staticbmesh {
        +{static} layer(bm, type, name)
        +{static} update(me, type, name, v)
        +{static} updater(type, bm_name, scn_name)
    }
}

package i18n {
    class i18n {
        +__init__(lang)
        +__getitem__(k)
    }
}

package Mesh {
    class Mesh {
        +__init__(me)
        +is_bmesh()
        +vertices()
        +polygons()
        +test_NON_ORTHO()
        +test_NON_2D()
        +test_NON_QUAD()
        +validate()
        +get_bmesh()
        +get_bbox(scaling_component = None)
        +get_domains(nm, scaling_component)
    }

    note "Uses bmesh from blender" as NoteBmesh
    NoteBmesh .. Mesh
}

package ops {
    note "User Operations" as noteOps

    class SaveImpulseResponse {
        +bl_idname
        +bl_label
        +filename_ext
        +filter_glob
        +setting_normalize
        +setting_filetype
        +execute(context)
        -poll(context)
    }

    class BakeSimulation {
        +get_domain_visses
        +bl_idname
        +bl_label
        +execute(context)
        -poll(context)
    }

    class StartSimulation {
        -run
        +bl_idname
        +bl_label
        +original_label
        +alternative_label
        +filename_ext
        +filter_glob
        +filepath
        +check_existing
        +invoke(context)
        +execute(context)
    }

    class StartSimulation {
        -run
        +bl_idname
        +bl_label
        +invoke(context)
    }

    class ClearSimulationData {
        +bl_idname
        +bl_label
        +execute(context)
        -poll(context)
    }

    class ClearSimulationData {
        +bl_idname
        +bl_label
        +is_running
        -timer
        +modal(context, events)
        +execute(context)
        +cancel(context)
    }
}

package props {
    class SimulationResultPathList {
        +path
    }

    class StaticData {
        +{static} STAND_ALONE
        +{static} default_python_path
        +{static} pstd_config_fn
        +{static} DEFAULT_GRID_SPACING
        +{static} DEFAULT_SOUND_SPEED
        +{static} grid_spacing_to_max_freq
        +{static} make_prop_updater(n1, b2, f)
        +{static} chain(*args)
        +{static} update_pstd_ini_file(key, value, section)
        +{static} get_from_pstd_ini_file(key, section)
        +{static} apply()
    }
}

package store {
    class data {
       +store
        +__getattr__(k)
        +__setattr__(k, v)
    }
}

package ui {
    class MenuItemHandler {
        +__init__(attachment, opname, icon, text)
        +register()
        +unregister()
    }
    class ImpulseResponseMenuItemHandler{
        +__init__()
    }
    class SettingsPanel {
        +bl_label
        +bl_idname
        +bl_space_type
        +bl_region_type
        +bl_context

        +draw(context)
    }

    note "user interface" as noteUi
}

package visualization {
    class StaticData {
        +{static} VISMAT_NAME
        +{static} linear_scale(max_value)
    }

    class ColorMap {
        +__call__(v)
    }

    class ColorMapHot {
        +f(s, v)
    }

    class Grid {
        +db_scale
        +cur_frame
        +matrix_key
        +invalidation
        +dbs_colors
        +__init__(w, h, x, y, sx, sy)
        +update(fr, z)
        +update_colors()
        +move(mat)
        +draw()
        +to_object(parent_name, subdomain_info, ob)
        +{static} from_subdomain_data(data)
    }

    class Domain {
        +{static} draw(ob, me, d)
    }

    class ColorBar {
        +{static} draw(rw, rh, dbs)
    }

    class ImpulseResponse {
        +{static} draw(r1)
    }

    class DrawHandler {
        +__init__(area_type, callback)
        +register()
        +unregister()
    }

    class Handler {
        +__init__(area_type, callback)
        +register()
        +unregister()
    }

}


note "Move function to a class" as N1
N1 .. StaticData
N1 .. Staticbmesh

note "Rename class" as NoteRename
NoteRename .. S

DomainInfo "1" *-- "*" DomainInfo.SubDomainInfo

@enduml