Esempio n. 1
0
void POLY_BLOCK::reflect_in_y_axis() {
  ICOORDELT *pt;                 // current point
  ICOORDELT_IT pts = &vertices;  // Iterator.

  do {
    pt = pts.data();
    pt->set_x(-pt->x());
    pts.forward();
  }
  while (!pts.at_first());
  compute_bb();
}
Esempio n. 2
0
void POLY_BLOCK::move(              //constructor
                      ICOORD shift  //cos,sin of angle
                     ) {
  ICOORDELT *pt;                 //current point
  ICOORDELT_IT pts = &vertices;  //iterator

  do {
    pt = pts.data ();
    *pt += shift;
    pts.forward ();
  }
  while (!pts.at_first ());
  compute_bb();
}
Esempio n. 3
0
void POLY_BLOCK::rotate(FCOORD rotation) {
  FCOORD pos;                    //current pos;
  ICOORDELT *pt;                 //current point
  ICOORDELT_IT pts = &vertices;  //iterator

  do {
    pt = pts.data ();
    pos.set_x (pt->x ());
    pos.set_y (pt->y ());
    pos.rotate (rotation);
    pt->set_x ((inT16) (floor (pos.x () + 0.5)));
    pt->set_y ((inT16) (floor (pos.y () + 0.5)));
    pts.forward ();
  }
  while (!pts.at_first ());
  compute_bb();
}