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

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

GDK used by developers since 1999, distributed on the web since 2002

  • Property svn:eol-style set to native
File size: 1.0 KB
Line 
1// This file is a part of the Framsticks GDK.
2// Copyright (C) 1999-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"
10#include <frams/param/param.h>
11
12//Growth parameters; see http://www.framsticks.com/foraminifera
13struct fF_growth_params
14{
15        int number_of_chambers;
16        double scalex, scaley, scalez;
17        double translation;
18        double angle1, angle2;
19
20        static ParamEntry paramtab[];
21        Param param;
22
23        fF_growth_params()
24                :param(paramtab, this)
25        {
26                reset();
27        }
28
29        void reset()
30        {
31                param.setDefault();
32        }
33
34        bool load(const char* serialized)
35        {
36                SString s = serialized;
37                int p = 0; //position in string
38                return ((param.load2(s, p) == 7) && (p == s.len()));
39        }
40
41        string save()
42        {
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);
46        }
47};
48
49#endif
Note: See TracBrowser for help on using the repository browser.