Skip to content

Commit

Permalink
fix(drawer): fix visibility drawer toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed Aug 18, 2022
1 parent 6b31f19 commit 3d6a4f2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
8 changes: 7 additions & 1 deletion pv_visualizer/app/engine/proxymanager/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,14 @@
"vtkSMIntRangeDomain": domain_helpers.domain_range,
"vtkSMEnumerationDomain": domain_helpers.domain_list_entries,
"vtkSMRepresentationTypeDomain": domain_helpers.domain_list_strings,
"vtkSMRendererDomain": domain_helpers.domain_list_strings,
"vtkSMProxyListDomain": domain_helpers.domain_list_proxies_simput_ids,
"vtkSMArrayListDomain": domain_helpers.domain_list_arrays,
"vtkSMRepresentedArrayListDomain": domain_helpers.domain_list_arrays,
"vtkSMArrayRangeDomain": domain_helpers.domain_range,
"vtkSMStringListDomain": domain_helpers.domain_list_strings,
# ------------------------------------------------
"vtkSMDataTypeDomain": DOMAIN_TYPE_DEFAULT,
# "vtkSMDataTypeDomain": DOMAIN_TYPE_DEFAULT,
"vtkSMInputArrayDomain": DOMAIN_TYPE_DEFAULT,
"vtkSMProxyGroupDomain": DOMAIN_TYPE_DEFAULT,
"vtkSMDataAssemblyDomain": DOMAIN_TYPE_DEFAULT,
Expand All @@ -130,3 +132,7 @@
"vtkSMMaterialDomain": DOMAIN_TYPE_DEFAULT,
"vtkSMArraySelectionDomain": DOMAIN_TYPE_DEFAULT,
}

DOMAINS_TO_SKIP = {
"vtkSMDataTypeDomain": 1,
}
11 changes: 10 additions & 1 deletion pv_visualizer/app/engine/proxymanager/domains.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import logging
from trame_simput.core.domains import PropertyDomain, register_property_domain
from . import paraview, decorators
from .const import PANEL_WIDGETS, WIDGETS, DOMAIN_TYPES, DOMAIN_TYPE_DEFAULT
from .const import (
PANEL_WIDGETS,
WIDGETS,
DOMAIN_TYPES,
DOMAIN_TYPE_DEFAULT,
DOMAINS_TO_SKIP,
)

logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
Expand Down Expand Up @@ -151,4 +157,7 @@ def get_domain_widget(domain):
if domain.GetClassName() in ["vtkSMDoubleRangeDomain", "vtkSMIntRangeDomain"]:
keep = domain.GetMinimumExists(0) and domain.GetMaximumExists(0)

if keep and name in DOMAINS_TO_SKIP:
keep = False

return keep, name, widget, ui_attributes
2 changes: 1 addition & 1 deletion pv_visualizer/app/ui/state_change.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def initialize(server):

@state.change("active_controls")
def update_active_panel(active_controls, **kwargs):
state.drawer_visibility = active_controls is not None
state.main_drawer = active_controls is not None

@ctrl.add("on_active_proxy_change")
def update_active_proxies(**kwargs):
Expand Down

0 comments on commit 3d6a4f2

Please sign in to comment.