Making Sense of Visual Model Attributes in SAMSON

Molecular modelers often face challenges in organizing and visualizing complex molecular data effectively. If you’ve ever struggled with tailoring visual elements in your molecular models, SAMSON’s visualModel attribute space might be the solution you’re looking for. This blog post dives into visual model attributes—essential components of the Node Specification Language (NSL)—which help you control how molecular structures are visually represented within SAMSON.

What Are Visual Model Attributes?

In SAMSON, a visual model refers to nodes that are designed specifically for visual representation. These nodes contain attributes that determine whether certain elements are visible, selected, or own visual properties like materials. By leveraging the visualModel attribute space (with the short name vm), you can precisely define how these visual components behave.

Key Attributes You Should Know

Here’s a quick overview of some key visualModel attributes:

  • hasMaterial (hm): This attribute specifies whether a visual model node has a material associated with it. Possible values are true or false. Examples include vm.hm (checks if material exists) and not vm.hm (checks if there is no material).
  • hidden (h): Determines whether the node is hidden. Use cases: vm.h (hidden) or not vm.h (visible).
  • name (n): Defines or filters nodes by name. For example, vm.n "A" targets nodes named “A,” while vm.n "L*" captures nodes whose names start with “L.”
  • ownsMaterial (om): Identifies whether a visual model node owns its material property. Use vm.om to check this.
  • visibilityFlag (vf): Flags visibility of nodes programmatically. Examples include vm.vf false to disable visibility or vm.vf to enable it.

These attributes are inherited from the broader node attribute space, with slight modifications for visual model nodes.

Why These Attributes Matter

Imagine working on a large molecular system where certain visual markers provide critical insights into specific regions or features. Visual model attributes let you:

  • Highlight selected molecular elements by toggling selected and selectionFlag attributes.
  • Programmatically hide or show components during simulations or visual analysis (hidden, visible, and visibilityFlag).
  • Define visual properties like materials to differentiate regions (e.g., surface roughness or transparency using hasMaterial and ownsMaterial).

How to Apply These Attributes

The power of these attributes lies in how you define them in NSL expressions. For example:

  • To identify all visual nodes that are visible and own materials, use: vm.v and vm.om.
  • To find nodes hidden from the visual model, try: not vm.v.
  • To select nodes whose name starts with “L,” use: vm.n "L*".

Efficient use of these controls can significantly improve clarity and precision when navigating large molecular assemblies.

Learn More

To explore more about visual model attributes and see detailed documentation, visit the official page: Visual Model Attributes in SAMSON.

Note: SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at samson-connect.net.

Comments are closed.