When working on complex molecular systems, keeping your modeling environment organized and understandable is essential. As a molecular modeler, you’ve probably faced situations where your scene becomes cluttered with numerous elements, making it harder to focus on specific parts of the structure. This raises an important question: how can you effectively control what’s displayed in your SAMSON workspace without losing critical data?
This blog post explores how SAMSON allows you to fine-tune your modeling scene by using visibility-related attributes within the presentation attribute space of the Node Specification Language (NSL). We’ll explain what attributes like hidden, visible, and visibilityFlag mean, and how they differ. Mastering these can help streamline your workflow and improve your modeling experience.
Understanding Visibility in NSL
Visibility control in SAMSON is more nuanced than it might initially appear. There are three main attributes that govern how presentation nodes are displayed:
pr.h(hidden)pr.v(visible)pr.vf(visibilityFlag)
These attributes affect how objects are shown or hidden, but they operate at different levels.
1. pr.h: Hidden
The hidden attribute (short name: h) is directly inherited from the general node.hidden attribute. When this attribute is set to true, the node is explicitly hidden, regardless of any visibility flag. In NSL, you can check for hidden elements using:
pr.h or pr.h true
To select only visible elements, use:
not pr.h
2. pr.v: Visible
The visible attribute (short name: v) defines whether a node is effectively visible in the modeling window. Think of it as the final result of all visibility conditions. You might be surprised to find that an element is not visible even if its visibilityFlag is set to true—because it could also be hidden explicitly with pr.h.
To find what you can actually see, use:
pr.v
Or to exclude all visible objects:
not pr.v
3. pr.vf: Visibility Flag
The visibilityFlag attribute (short name: vf) is a control signal contributing to the overall visibility. It’s like a ‘permission’ to show the node, but it doesn’t override explicit hiding. Using this flag, you can identify structures that are allowed to be visible (but might still not be due to hidden settings):
pr.vf
To check which nodes don’t have this visibility flag set, try:
pr.vf false
Putting It All Together
Understanding the logic of these attributes allows you to write precise queries when filtering or selecting visual elements in SAMSON. Here are a few practical queries:
- Select all visible presentation nodes:
pr.v - Find all explicitly hidden presentation nodes:
pr.h - Identify nodes that could be visible but are hidden by flag conditions:
pr.vf and not pr.v
This knowledge can be especially valuable when scripting NSL-based automation tools or extensions where you want to ensure just the right elements are being manipulated or displayed.
For a deeper dive into how SAMSON handles presentation attributes, please visit the official documentation page: NSL – Presentation Attributes.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at www.samson-connect.net.
