Skip to content
  • Recent
  • Tags
  • Popular
  • SAMSON Connect
  • Get SAMSON
Collapse
SAMSON Forum
  1. Home
  2. Develop
  3. GUI
  4. Import new "version" of the molecule

Import new "version" of the molecule

Scheduled Pinned Locked Moved GUI
7 Posts 3 Posters 6.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • LaëtitiaL
    LaëtitiaL
    Laëtitia
    wrote on last edited by
    #1

    Hello,

    In the development on my app I would like at some moment to "reload" the view of the molecule. To import a new molecule and either forgetting about the one already displayed or save it somewhere. Which functions should I use?
    Thanks for help.
    Laëtitia

    1 Reply Last reply
    0
    • DmitriyMarinD
      DmitriyMarinD
      DmitriyMarin
      wrote on last edited by
      #2

      Hello @Laëtitia

      You can export and import molecules using the following functions:

      #include "SAMSON.hpp"
      
      ...
      
      SBNodeIndexer nodeIndexer;
      SAMSON::getActiveDocument()->getNodes(nodeIndexer);    // get an indexer of all nodes in the active document
      SAMSON::exportToFile(nodeIndexer, "pathToMolecule/export.pdb"); // export these nodes to a file
      
      SAMSON::getActiveDocument()->erase(); // close the active document
      
      SAMSON::importFromFile("pathToMolecule/import.pdb"); // import a molecule from a file
      

      Importers and exporters will be detected by SAMSON based on the extension of the filenames.

      Dmitriy,
      The SAMSON Team, https://s-c.io

      1 Reply Last reply
      1
      • LaëtitiaL
        LaëtitiaL
        Laëtitia
        wrote on last edited by
        #3

        It works like a charm and it seems so natural once you've seen it once.

        Thanks a lot

        1 Reply Last reply
        0
        • LaëtitiaL
          LaëtitiaL
          Laëtitia
          wrote on last edited by
          #4

          Another related question, is there a way to have several windows to display several molecules? (each one sitting in a different window with it's individual internal coordinates?)

          1 Reply Last reply
          0
          • StephaneS
            StephaneS
            Stephane
            wrote on last edited by
            #5

            Hi Laëtitia, it's not yet possible to have several windows simultaneously. For now, the molecules should be opened in different documents. Would you like to have several views of the same document? Or be able to render a molecule by itself even without it being part of a document?

            1 Reply Last reply
            0
            • LaëtitiaL
              LaëtitiaL
              Laëtitia
              wrote on last edited by
              #6

              I was more thinking of the later, for example to see the initial state or another conformer.

              1 Reply Last reply
              0
              • StephaneS
                StephaneS
                Stephane
                wrote on last edited by
                #7

                Ok thanks! We'll see how we could do that!

                1 Reply Last reply
                0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Recent
                • Tags
                • Popular
                • SAMSON Connect
                • Get SAMSON