Ignore:
Timestamp:
07/03/20 00:32:23 (4 years ago)
Author:
Maciej Komosinski
Message:
  • separate "0" and "0s" formats (for SHAPE_BALL_AND_STICK and SHAPE_SOLIDS, respectively)
  • converting to format list (Geno::F0_FORMAT_LIST = "0,0s")
  • (optional) declaring Model as SHAPE_BALL_AND_STICK or SHAPE_SOLIDS (or SHAPE_UNKNOWN)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/_demos/genoconv_test.cpp

    r955 r972  
    11// This file is a part of Framsticks SDK.  http://www.framsticks.com/
    2 // Copyright (C) 1999-2018  Maciej Komosinski and Szymon Ulatowski.
     2// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
    33// See LICENSE.txt for details.
    44
     
    1616 */
    1717
    18 /// Sample Geno converter not using Model class.
    19 /// (This converter generates the same output for each input).
    20 /// Such a converter is responsible for doing valid f0 (or other format) output and storing temporary data.
     18 /// Sample Geno converter not using Model class.
     19 /// (This converter generates the same output for each input).
     20 /// Such a converter is responsible for doing valid f0 (or other format) output and storing temporary data.
    2121class GenoConv_Test : public GenoConverter
    2222{
     
    8484        for (t = src; *t; t++)
    8585        {
    86                 if (insideneuron&&*t == ']') insideneuron = 0;
     86                if (insideneuron && *t == ']') insideneuron = 0;
    8787                if (*t == '[') insideneuron = 1;
    8888                if ((!insideneuron) && isdigit(*t) && t[1])
     
    9393                                dst += *t;
    9494                        if (map) // fill in the map only if requested
    95                                 map->add(t - src, t - src, dst.len() - n, dst.len() - 1);
     95                                map->add(t - src, t - src, dst.length() - n, dst.length() - 1);
    9696                        // meaning: source character (t-src) becomes (dst.len()-n ... dst.len()-1)
    9797                }
     
    100100                        dst += *t;
    101101                        if (map)
    102                                 map->add(t - src, t - src, dst.len() - 1, dst.len() - 1);
     102                                map->add(t - src, t - src, dst.length() - 1, dst.length() - 1);
    103103                        // meaning: map single to single character: (t-src) into (dst.len()-1)
    104104                }
     
    113113{
    114114        printf("Genotype:\n%s\nFormat: %s\nValid: %s\nComment: %s\n",
    115                g.getGenes().c_str(), g.getFormat().c_str(), g.isValid() ? "yes" : "no", g.getComment().c_str());
     115                g.getGenes().c_str(), g.getFormat().c_str(), g.isValid() ? "yes" : "no", g.getComment().c_str());
    116116}
    117117
     
    167167        if (using_checkpoints)
    168168        { // using Model with checkpoints
    169                 Model m1(g2, false, true);//true=using_checkpoints
     169                Model m1(g2, Model::SHAPE_UNKNOWN, false, true);//true=using_checkpoints
    170170                printf("\nModel built from the converted f%s genotype has %d checkpoints\n", g2.getFormat().c_str(), m1.getCheckpointCount());
    171                 Model m2(g1, false, true);//true=using_checkpoints
     171                Model m2(g1, Model::SHAPE_UNKNOWN, false, true);//true=using_checkpoints
    172172                printf("Model built from the source f%s genotype has %d checkpoints\n", g1.getFormat().c_str(), m2.getCheckpointCount());
    173173                // accessing individual checkpoint models (if available)
     
    195195                }
    196196
    197                 Model mod1(g1, 1);
     197                Model mod1(g1, Model::SHAPE_UNKNOWN, 1);
    198198                printf("\nModel map for f%s genotype:\n", g1.getFormat().c_str());
    199199                ModelDisplayMap dm1(mod1);
     
    202202                mod1combined.addCombined(mod1.getMap(), dm1.getMap());
    203203                mod1combined.print();
    204                 Model mod2(g2, 1);
     204                Model mod2(g2, Model::SHAPE_UNKNOWN, 1);
    205205                printf("\nModel map for f%s genotype:\n", g2.getFormat().c_str());
    206206                ModelDisplayMap dm2(mod2);
Note: See TracChangeset for help on using the changeset viewer.