Ignore:
Timestamp:
12/05/14 08:09:47 (9 years ago)
Author:
Maciej Komosinski
Message:

Added support for genetic mapping in f9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/f9/conv_f9.h

    r197 r259  
    2121struct XYZ_LOC
    2222{
    23         int x,y,z; //coordinates xyz of a vertex - represented as int's so that it is easy and safe to check identity. Could also be done using lists of Model's Parts, but that would involve comparing floats
    24         XYZ_LOC() {x=y=z=0;}
    25         void add(int delta[3]) {x+=delta[0]; y+=delta[1]; z+=delta[2];}
    26         bool same_coordinates(const XYZ_LOC &loc) {return x==loc.x && y==loc.y && z==loc.z;}
     23        int x, y, z; //coordinates xyz of a vertex - represented as int's so that it is easy and safe to check identity. Could also be done using lists of Model's Parts, but that would involve comparing floats
     24        XYZ_LOC() { x = y = z = 0; }
     25        void add(int delta[3]) { x += delta[0]; y += delta[1]; z += delta[2]; }
     26        bool same_coordinates(const XYZ_LOC &loc) { return x == loc.x && y == loc.y && z == loc.z; }
    2727};
    2828
    2929
    3030// The f9->f0 converter
    31 class GenoConv_f90: public GenoConverter
     31class GenoConv_f90 : public GenoConverter
    3232{
    3333public:
     
    3939protected:
    4040        //auxiliary methods
    41         int addSegment(Model &m,vector<XYZ_LOC> &vertices,const XYZ_LOC &new_vertex,int recently_added);
    42         int findVertexAt(vector<XYZ_LOC> &vertices,const XYZ_LOC &new_vertex);
    43         int addNewVertex(Model &m,vector<XYZ_LOC> &punkty,const XYZ_LOC &nowypunkt);
     41        int addSegment(Model &m, int genenr, vector<XYZ_LOC> &vertices, const XYZ_LOC &new_vertex, int recently_added);
     42        int findVertexAt(vector<XYZ_LOC> &vertices, const XYZ_LOC &new_vertex);
     43        int addNewVertex(Model &m, vector<XYZ_LOC> &punkty, const XYZ_LOC &nowypunkt);
    4444        void setColors(Model &m); //sets fixed (independent from genes) colors and widths on a model, purely for aesthetic purposes
    4545        void perturbPartLocations(Model &m); //deterministic "body noise", see APPLY_DETERMINISTIC_BODY_NOISE
Note: See TracChangeset for help on using the changeset viewer.