Changeset 259 for cpp/frams/genetics/f9/conv_f9.h
- Timestamp:
- 12/05/14 08:09:47 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/genetics/f9/conv_f9.h
r197 r259 21 21 struct XYZ_LOC 22 22 { 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 floats24 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; } 27 27 }; 28 28 29 29 30 30 // The f9->f0 converter 31 class GenoConv_f90 : public GenoConverter31 class GenoConv_f90 : public GenoConverter 32 32 { 33 33 public: … … 39 39 protected: 40 40 //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); 44 44 void setColors(Model &m); //sets fixed (independent from genes) colors and widths on a model, purely for aesthetic purposes 45 45 void perturbPartLocations(Model &m); //deterministic "body noise", see APPLY_DETERMINISTIC_BODY_NOISE
Note: See TracChangeset
for help on using the changeset viewer.