source: cpp/frams/genetics/fF/fF_genotype.h @ 176

Last change on this file since 176 was 176, checked in by Maciej Komosinski, 10 years ago

Renamed #defines that conflicted with system-wide defines for Windows (added fF_ prefix), updated ranges for scaling parameters, updated the simplest genotype, formatted sources

  • Property svn:eol-style set to native
File size: 1.0 KB
RevLine 
[140]1// This file is a part of the Framsticks GDK.
2// Copyright (C) 2002-2014  Maciej Komosinski and Szymon Ulatowski.  See LICENSE.txt for details.
3// Refer to http://www.framsticks.com/ for further information.
4
5#ifndef _FF_GENOTYPE_H_
6#define _FF_GENOTYPE_H_
7
8#include <stdio.h>
9#include "common/stl-util.h"
[145]10#include <frams/param/param.h>
[140]11
[176]12//Growth parameters; see http://www.framsticks.com/foraminifera
[140]13struct fF_growth_params
14{
15        int number_of_chambers;
[145]16        double scalex, scaley, scalez;
17        double translation;
[140]18        double angle1, angle2;
19
[145]20        static ParamEntry paramtab[];
21        Param param;
22
[140]23        fF_growth_params()
[145]24                :param(paramtab, this)
[140]25        {
26                reset();
27        }
28
29        void reset()
30        {
[145]31                param.setDefault();
[140]32        }
33
34        bool load(const char* serialized)
35        {
[145]36                SString s = serialized;
37                int p = 0; //position in string
[176]38                return ((param.load2(s, p) == 7) && (p == s.len()));
[140]39        }
40
41        string save()
42        {
[145]43                SString tmp;
44                param.save2(tmp, NULL/*object containing default values for comparison*/, false/*add CR*/, false/*force field names*/);
45                return string((const char*)tmp);
[140]46        }
47};
48
49#endif
Note: See TracBrowser for help on using the repository browser.