Ejemplo n.º 1
0
    bool Mutate() {
        bool dirty = false;

        if (DoMutate(AddPolyMutation))
            dirty |= AddPoly(); 
        if (DoMutate(DelPolyMutation))
            dirty |= DelPoly();
        if (DoMutate(MovePolyMutation))
            dirty |= MovePoly();

        for (PolyIt it = poly_.begin(); it != poly_.end(); ++it)
            dirty |= it->Mutate();

        return dirty;
    }
Ejemplo n.º 2
0
//Resets polygon for arrow to avoid cumulative rounding errors
void ResetArrow() {
	//define a triangle polygon
	arrow[0].x=80;
	arrow[0].y=20;
	arrow[1].x=50;
	arrow[1].y=90;
	arrow[2].x=80;
	arrow[2].y=70;
	arrow[3].x=110;
	arrow[3].y=90;
	//I could define it small but I
	//wanted to test these routines!
	ScalePoly(4, arrow, 80, 60, 0.3);
	MovePoly(4, arrow, -60, -40);
}