For molecular modelers aiming to customize or precisely control how molecular structures are represented visually, understanding Visual Model Attributes is essential. In SAMSON, these attributes are defined in the visualModel attribute space (short name: vm), which focuses solely on visual model nodes. This allows users to set attributes that affect the visibility, selection, and material properties of visual elements within molecular models. Let’s dive into some key attributes and how they can enhance your modeling workflow.
The Basics: Visual Model Attributes
The visualModel attribute space includes several attributes inherited from the general node attribute space. Here’s a summary of the most commonly used attributes:
- hasMaterial (hm): Specifies whether a visual model has associated material properties (
trueorfalse). - hidden (h): Determines if the visual element is hidden (
true) or shown (false). - name (n): Captures the name of the visual node as a string. For example,
vm.n "Protein Structure". - ownsMaterial (om): Indicates if the visual node owns material properties (
trueorfalse). - selected: Shows whether the visual node is currently selected. Note that this attribute does not have a short name in this context.
- selectionFlag (sf): Marks whether a node’s selection flag is
trueorfalse. - visibilityFlag (vf): Controls the visibility state of the node.
- visible (v): Specifies whether the node is visible (
true) or not.
Examples to Enhance Your Workflow
Here are a few practical examples that illustrate how these attributes might be used effectively:
- Check material existence: To find out whether a visual node has material properties, use
vm.hm. This is particularly useful when working with molecular visualization methods like surface coloring. - Quickly hide elements: Suppose you want to conceal a certain part of your visual model temporarily. Setting
vm.htotruehides the element. - Selection filtering: The
vm.selectedattribute helps you identify elements that are currently selected. For example, usenot vm.selectedto exclude non-selected nodes from further operations. - Flexible name matching: By using patterns with the
nameattribute, such asvm.n "L*", you can target specific nodes dynamically (e.g., matching all nodes whose names start with “L”).
Why These Attributes Matter
The capacity to interact with these visual model attributes provides you with a layer of control crucial for understanding and presenting molecular data. Attributes like hasMaterial and ownsMaterial help manage material assignments, making it easier to apply physicochemical properties. Likewise, manipulating hidden, visible, and visibilityFlag can streamline workflows where clarity and focus on specific parts of a model are key. Whether you’re preparing publication-ready visuals or dissecting molecular structures interactively, these tools are indispensable.
To explore more detailed information about visual model attributes, visit the full documentation page here: SAMSON Visual Model Attributes Documentation.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON from https://www.samson-connect.net.
