SAMSON Extensions#
A SAMSON Extension is a loadable module built with the SAMSON SDK and distributed through SAMSON Connect or internally inside your team.
This page explains how to think about extensions as a developer:
- an extension is a package
- that package can expose one or more classes
- each exposed class plays a specific role inside SAMSON
Without extensions, SAMSON is intentionally minimal. Extensions are what add file formats, editors, scientific models, simulation tools, visualization features, and many domain-specific workflows.
How extensions integrate with SAMSON#
Extensions expose functionality through the introspection mechanism. That is what lets SAMSON and other extensions discover classes, call exposed functions, serialize objects, reuse functionality across package boundaries, and surface features in scripting or UI workflows.
In practice, a single extension may contain:
- one or more extension classes such as apps, editors, importers, exporters, or models
- support code that is not directly exposed
- resources such as icons, forms, documentation, and data files
The Extension Generator creates the expected project layout and is the standard place to start.
Choosing the right extension type#
The easiest way to choose an extension type is to ask how the user will reach your feature.
Use an app for command-style tools#
Apps are the most general extension type. Use an app when your feature is launched from the UI, performs a calculation or workflow, calls an external tool or web service, or opens its own control window.
Typical examples:
- a geometry analysis tool
- a connector to an external solver
- a data-processing workflow
- a utility that batches operations on selected nodes
Apps appear in Home > Apps.
Use an editor for interactive viewport tools#
Editors receive mouse, keyboard, and viewport interaction events. Use an editor when the user manipulates objects directly in the 3D view.
Typical examples:
- a creation tool
- a transform or deformation tool
- a selection tool
- an interactive modeling instrument
Only one editor is active at a time.
Use an importer or exporter for file formats#
Importers read external files and turn them into SAMSON data graph content. Exporters do the opposite and write SAMSON content to external files.
Use them when your main job is format translation rather than interactive behavior.
Typical examples:
- PDB, XYZ, or CIF readers and writers
- density map importers
- project exchange formats for external tools
Use models and simulators for scientific behavior#
Many scientific extensions are model- or simulation-centric rather than purely UI-centric.
The modeling and simulation page describes the full taxonomy, but the most common cases are:
- interaction models for energies and forces
- visual models for viewport representation
- state updaters for state changes such as position updates
- simulators for driving time evolution or iterative computations
Use these types when your feature becomes part of the scientific state or runtime behavior of a system rather than just a command wrapper.
Use custom nodes when you need new data graph objects#
If the built-in node types are not enough, an extension can define new data graph node classes. This is the right choice when your extension owns new persistent data or introduces a new structural concept in the data graph.
A practical mental model#
Most real extensions combine several roles.
Example:
- an importer reads a custom file format
- it creates one or more custom nodes
- a visual model renders them
- an app exposes high-level commands
- an editor lets the user manipulate them interactively
Thinking in these roles makes it easier to decide where code belongs and which base classes you should derive from.
Extension categories#
Each extension can belong to one or more categories:
- Assembly
- Biology
- Chemistry
- Developer
- Education
- Electronics
- General
- Materials
- Medicine
- Metrology
- Modeling
- Optics
- Particles
- Pharmacy
- Photonics
- Physics
- Simulation
- Toxicology
- Visualization
Categories are assigned at the extension level, not per class. They are used to organize extensions in the SAMSON UI and on SAMSON Connect.
What to read next#
- Read Apps, Editors, Importers, and Exporters for role-specific details.
- Read Modeling and simulation if your extension computes, updates, or visualizes scientific state.
- Read Introspection once you need to expose classes and functions across extension boundaries.