[140] | 1 | // This file is a part of the Framsticks GDK. |
---|
[197] | 2 | // Copyright (C) 1999-2014 Maciej Komosinski and Szymon Ulatowski. See LICENSE.txt for details. |
---|
[140] | 3 | // Refer to http://www.framsticks.com/ for further information. |
---|
| 4 | |
---|
| 5 | #ifndef _CONV_FF_H_ |
---|
| 6 | #define _CONV_FF_H_ |
---|
| 7 | |
---|
[176] | 8 | #define fF_TOO_MUCH 0.75 |
---|
| 9 | #define fF_TOO_LITTLE 0.10 |
---|
[174] | 10 | |
---|
[176] | 11 | #define fF_HOLE_RADIUS 0.05f |
---|
| 12 | #define fF_LONGITUDE_NUM 69 |
---|
[174] | 13 | |
---|
[176] | 14 | #define fF_LATITUDE_NUM ((fF_LONGITUDE_NUM - 1)*2) |
---|
| 15 | #define fF_AMOUNT ((fF_LATITUDE_NUM)*(fF_LONGITUDE_NUM)) |
---|
[174] | 16 | |
---|
[176] | 17 | #define fF_THICK_RATIO 0.95 |
---|
[174] | 18 | |
---|
[176] | 19 | #define fF_SIZE fF_LONGITUDE_NUM * fF_LATITUDE_NUM + fF_LATITUDE_NUM |
---|
[174] | 20 | |
---|
[140] | 21 | #include <frams/util/multimap.h> |
---|
| 22 | #include <frams/util/sstring.h> |
---|
| 23 | #include <frams/genetics/genoconv.h> |
---|
[174] | 24 | #include "fF_chamber3d.h" |
---|
[140] | 25 | |
---|
[178] | 26 | |
---|
| 27 | //A point on the surface of a chamber |
---|
| 28 | struct fF_point |
---|
| 29 | { |
---|
| 30 | double x, y, z; |
---|
| 31 | bool inside; //helper field used when computing whether this point is inside some chamber |
---|
| 32 | }; |
---|
| 33 | |
---|
| 34 | |
---|
[174] | 35 | // The f9->f0 converter |
---|
| 36 | class GenoConv_fF0 : public GenoConverter { |
---|
[140] | 37 | public: |
---|
[176] | 38 | GenoConv_fF0(); |
---|
| 39 | ~GenoConv_fF0(); |
---|
| 40 | //implementation of the GenoConverter method |
---|
| 41 | SString convert(SString &in, MultiMap *map); |
---|
[140] | 42 | |
---|
| 43 | protected: |
---|
[176] | 44 | void createSphere(int ktora, fF_chamber3d **chambers, double radius, double div_radius_length, double div_vector_length, |
---|
| 45 | double alpha, double gamma, double kx, double ky, double kz); |
---|
[178] | 46 | fF_point* generate_points(fF_chamber3d *chamber, int which, double kx, double ky, double kz); |
---|
[176] | 47 | double dist(double x1, double y1, double z1, double x2, double y2, double z2); |
---|
| 48 | void search_hid(int nr, fF_chamber3d **spheres, double kx_, double ky_, double kz_); |
---|
| 49 | int find_hole(int which, double x, double y, double z, fF_chamber3d **chambers, double kx_, double ky_, double kz_); |
---|
[178] | 50 | |
---|
| 51 | private: |
---|
| 52 | double* cosines; |
---|
| 53 | double* sines; |
---|
| 54 | void precompute_cos_and_sin(); |
---|
[140] | 55 | }; |
---|
| 56 | |
---|
| 57 | #endif |
---|