#import "aGroup-inter.h"
#import "aGroup.h"
#import "pgg.h"

@implementation pgg
- makeLatticeUnitAt: (NXPoint *) point fromImage: srcimg 
{
  id imgrep;
  NXPoint pt;
  
  pt.x = - point->x ;
  pt.y = - point->y ;
  imgrep = [srcimg bestRepresentation];
  PSgsave(); // lower left
  [self clip:0.0:0.0];[imgrep drawAt: &pt];
  PSgrestore();
  PSgsave(); // lower right
  reflect(0.0);
  PStranslate(frame.size.width,-frame.size.height);
  [self clip:0.0:0.0]; [imgrep drawAt: &pt];
  PSgrestore();
  PSgsave(); // upper left
  reflect(90);
  PStranslate(-frame.size.width,frame.size.height);
  PSgsave();
  [self clip:0.0:0.0]; [imgrep drawAt: &pt];
  PSgrestore();
  reflect(0.0);// upper right
  PStranslate(frame.size.width,-frame.size.height);
  [self clip:0.0:0.0]; [imgrep drawAt: &pt];
  PSgrestore();
  return self;
}
@end
