Programming a path generator

  In this tutorial, we are going to create an editor such that a user can create paths in the viewport. First, use the SAMSON Element Generator to create a new SAMSON Element called Path containing: An Editor class called Editor (full name: SEPathEditor). This class will make it possible for the user to add new nodes to the path. A Visual Model class called VisualModel (full name: SEPathVisualModel). This will be the main class used to represent a path…

More…

Building nanotubes models with SAMSON

In this quick tutorial, you will learn how to easily generate nanotube models within SAMSON. Nanotube creator First, make sure you have the Nanotube creator SAMSON Element that you can find on SAMSON Connect: If you need help with installing new SAMSON Elements to your SAMSON installation, please visit this page. If you need help with installing SAMSON itself, please visit this page. Note: you can check whether you have this SAMSON Element in at least three different ways: In…

More…

Integrating external programs

In this tutorial, we show how to call an external executable from SAMSON, in order to perform calculations based on selected atoms in the document. Setting up the external executable Implement the following program, and compile it to produce an executable called Barycenter: #include <sstream> #include <fstream> #include <string> #include <iostream>   int main() {   unsigned int numberOfAtoms;   // open the file   std::ifstream input("input.txt");   // read the number of atoms   std::string line; std::getline(input, line); std::stringstream…

More…

Creating novel visualizations

Please, refer to the updated version: Developer guide: Creating visualizations. This tutorial shows you how to create a new visual model that shows the van der Waals representation of a group of atoms. Setting up the SAMSON Element Use the SAMSON SDK Element Generator to create a new SAMSON Element called VanDerWaals, containing a visual model called SEVanDerWaalsVisualModel. We refer to the tutorial on generating the SAMSON Element for a reminder on how to use the SAMSON Element Generator. Setting up…

More…

Importing and exporting data

Please, refer to the updated version: Developer guide: Importing data Developer guide: Exporting data In this tutorial, we create an importer and an exporter for the xyz format. Start by creating a new SAMSON Element called XYZ with the SAMSON SDK Element Generator, and add an importer class (called SEXYZImporter) and an exporter class (SEXYZExporter). We refer to the tutorial on generating the SAMSON Element for a reminder on how to use the SAMSON Element Generator. Despite what the names…

More…

Handling units and dimensional analysis

Please, refer to the updated tutorial: Developer guide: Handling units. In this tutorial, we explore a bit more the role of units in SAMSON by developing an app that performs energy conversions. We refer you to the SDK documentation for an extensive description of the units mechanism in SAMSON. Setting up the SAMSON Element and its interface Use the SAMSON SDK Element Generator to create a new SAMSON Element called EnergyConverter, containing an app called SEEnergyConverterApp. We refer to the…

More…

Programming new apps

Please, refer to the updated version: Developer guide: Programming new apps. In this tutorial, you will learn how to program an App that shakes atoms in a document when the user presses a button. Generating the SAMSON Element First, use the SAMSON SDK Element Generator to create a new SAMSON Element containing one app class. We refer to the tutorial on generating the SAMSON Element for a reminder on how to use the SAMSON Element Generator. Call the SAMSON Element…

More…

Producing publication-quality images

This tutorial will show you how to customize renderings and generate publication-quality images and animations in SAMSON. Starting with SAMSON 0.6.0, the viewport can be captured by pressing F10 to easily save screenshots. Go to the Preferences panel (Edit / Preferences or SAMSON / Preferences on Mac), in the Interface / Captures section: This section lets you choose the folder in which captures are saved when pressing F10, the prefix used in filenames (prefix to which is appended an integer denoting…

More…

Snapping, cloning and extracting with selection editors

The new version of selection editors now includes the possibility of snapping to atoms and nodes, as well as cloning and extracting structural nodes. Selection editors (point, lasso and rectangle selection) can be found in the editors toolbar and the Edit menu:   Activate snapping by clicking twice a selection editor (or use the corresponding shortcut twice):   Snapping to atoms helps achieve precise positioning:   You may also snap to entire nodes:   For example, choose the “Structural models”…

More…

Snapping, cloning and extracting with selection editors

The new version of selection editors now includes the possibility of snapping to atoms and nodes, as well as cloning and extracting structural nodes. Selection editors (point, lasso and rectangle selection) can be found in the editors toolbar and the Edit menu:   Activate snapping by clicking twice a selection editor (or use the corresponding shortcut twice):   Snapping to atoms helps achieve precise positioning:   You may also snap to entire nodes:   For example, choose the “Structural models”…

More…