Changeset 157 for cpp/frams/genetics/fF


Ignore:
Timestamp:
03/01/14 22:38:45 (10 years ago)
Author:
sz
Message:

f9 and Ff converters can now detect an invalid input genotype and react appropriately

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/fF/conv_fF.cpp

    r140 r157  
    1919{
    2020        fF_growth_params gp;
    21         gp.load(in);
     21        if (!gp.load(in)) //invalid input genotype?
     22                return ""; //so we return an invalid f0 genotype
    2223        Model m;
    2324        m.open();
     
    3132        rotation.rotate(Pt3D(0, gp.angle1, gp.angle2)); //assumed rotation around x is 0, which is limiting if we use assymetrical shapes (i.e., not spheres). But the original model had only two angles...
    3233
    33         for (int i = 0; i < gp.number_of_chambers; i++, p1 = p2)
     34        for (int i = 1; i < gp.number_of_chambers; i++, p1 = p2)
    3435        {
    3536                p2 = m.addNewPart(Part::SHAPE_ELLIPSOID);
Note: See TracChangeset for help on using the changeset viewer.