Mastering Visibility and Selection in Visual Models

When designing molecular models, a common challenge for modelers is efficiently managing the display and organization of components within complex systems. Understanding and leveraging the attributes of visual models can greatly simplify this task and enhance productivity. For users of SAMSON’s Node Specification Language (NSL), these attributes provide powerful tools to control visibility, selection, and other key properties of visual elements.

In this post, we’ll explore how you can use the visualModel attribute space (short name: vm) to refine how your molecular models are displayed and manipulated. This includes attributes like visibility flag, selection flag, and more. Let’s break it down.

What is the visualModel Attribute Space?

The visualModel attribute space is a specialized namespace for attributes exclusively linked to visual model nodes. These attributes help modelers define and interact with the visual representation of molecular systems. Using the visualModel attribute space, you can filter nodes based on visibility, selection, and other properties.

Key Visual Model Attributes

Here’s a closer look at some key visualModel attributes and how they can be applied:

  • Visibility Control:
    The visible attribute (vm.v) is particularly important for determining the visibility of nodes. For example, you might hide certain nodes to focus on a specific region of a structure with expressions like not vm.v. Likewise, you can manage temporary visibility states using the visibilityFlag attribute (vm.vf).
  • Selection Management:
    Use the selected attribute (vm.selected) to identify or manage selected elements in your model, and combine this with the selectionFlag attribute (vm.sf) to set up custom selection behaviors.
  • Material Handling:
    Attributes like hasMaterial (vm.hm) and ownsMaterial (vm.om) let you quickly assess whether a node is associated with specific material properties, such as render styles or colors.
  • Using Names to Filter Nodes:
    The name attribute (vm.n) enables you to filter nodes by their assigned names. For example, filtering nodes named ‘A’ can be done with vm.n "A" or using wildcards for partial matches like vm.n "L*".

Examples in Action

Here are some practical examples of using the visualModel attributes:

Expression Description
vm.vf false Filters nodes where the visibility flag is set to false.
vm.n "Water" Selects nodes named “Water”.
not vm.hm Filters nodes that do not have materials associated with them.

Improving Workflow with SAMSON

Mastering these attributes enables molecular modelers to maximize their focus on pertinent structures while decluttering the interface. Whether it’s isolating a key region of a molecular structure or ensuring that critical nodes are highlighted, these capabilities make NSL usage faster and more intuitive.

To dive deeper into the visualModel attributes and see more use cases, visit the official documentation at https://documentation.samson-connect.net/users/latest/nsl/visualModel/.

SAMSON and all SAMSON Extensions are free for non-commercial use. Download SAMSON today at https://www.samson-connect.net.

Comments are closed.